From 32d54c0b5f79367ff1714d2b52880edaf07fe7bb Mon Sep 17 00:00:00 2001 From: xtqqczze Date: Wed, 18 Nov 2020 22:50:53 +0000 Subject: [PATCH 1/2] Enable SA1507: Code should not contain multiple blank lines in a row https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1507.md --- .globalconfig | 2 +- .../engine/TypeTable_Types_Ps1Xml.cs | 1 - test/tools/WebListener/Controllers/DosController.cs | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.globalconfig b/.globalconfig index ced5ff22453..fbe92c7c396 100644 --- a/.globalconfig +++ b/.globalconfig @@ -1373,7 +1373,7 @@ dotnet_diagnostic.SA1505.severity = none dotnet_diagnostic.SA1506.severity = none # SA1507: Code should not contain multiple blank lines in a row -dotnet_diagnostic.SA1507.severity = none +dotnet_diagnostic.SA1507.severity = warning # SA1508: Closing braces should not be preceded by blank line dotnet_diagnostic.SA1508.severity = none diff --git a/src/System.Management.Automation/engine/TypeTable_Types_Ps1Xml.cs b/src/System.Management.Automation/engine/TypeTable_Types_Ps1Xml.cs index aad2f70246e..5a7133b7cd3 100644 --- a/src/System.Management.Automation/engine/TypeTable_Types_Ps1Xml.cs +++ b/src/System.Management.Automation/engine/TypeTable_Types_Ps1Xml.cs @@ -9227,7 +9227,6 @@ private void Process_Types_Ps1Xml(string filePath, ConcurrentBag errors) #if UNIX #region UnixStat - if (ExperimentalFeature.IsEnabled("PSUnixFileStat")) { typeName = @"System.IO.FileSystemInfo"; diff --git a/test/tools/WebListener/Controllers/DosController.cs b/test/tools/WebListener/Controllers/DosController.cs index 6024430095e..7fc138e0e81 100644 --- a/test/tools/WebListener/Controllers/DosController.cs +++ b/test/tools/WebListener/Controllers/DosController.cs @@ -22,7 +22,6 @@ public string Index() Response.StatusCode = 200; - StringValues dosType; if (Request.Query.TryGetValue("dosType", out dosType)) { From c978b0576ff54ff96f4e6c5dea9c18cfae122983 Mon Sep 17 00:00:00 2001 From: xtqqczze Date: Fri, 20 Nov 2020 08:50:01 +0000 Subject: [PATCH 2/2] Fix SA1507 --- src/powershell/Program.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/powershell/Program.cs b/src/powershell/Program.cs index 9f2af53e758..732b4db5888 100644 --- a/src/powershell/Program.cs +++ b/src/powershell/Program.cs @@ -185,7 +185,6 @@ private static void AttemptExecPwshLogin(string[] args) // We can reuse this value later to prevent needing to call a .NET API // to generate our exec invocation. - // We don't care about argc's value, since argv[0] must always exist. // Skip over argc, but remember where exec_path is for later executablePathPtr = IntPtr.Add(procargs, sizeof(int));