Skip to content

Commit 106d04d

Browse files
committed
Enable IDE0005 (unneccessary using statements) as error
Due to a quirk in how `msbuild` runs rules, documentation generation must be enabled for this rule (and presumably others) to be respected.
1 parent 2e30add commit 106d04d

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

PowerShellEditorServices.Common.props

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
<!-- See: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview -->
1515
<EnableNETAnalyzers>true</EnableNETAnalyzers>
1616
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
17+
<!-- Required to enable IDE0005 as error -->
18+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1719
<!-- TODO: Enable <AnalysisMode>All</AnalysisMode> -->
1820
<!-- See: https://docs.microsoft.com/en-us/dotnet/core/compatibility/sdk/6.0/implicit-namespaces -->
1921
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>

src/PowerShellEditorServices.Hosting/EditorServicesLoader.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT License.
33

44
using System;
5-
using System.Diagnostics;
65
using System.IO;
76
using System.Reflection;
87
using System.Threading.Tasks;
@@ -13,6 +12,10 @@
1312
using System.Management.Automation;
1413
using System.Management.Automation.Runspaces;
1514

15+
#if DEBUG
16+
using System.Diagnostics;
17+
#endif
18+
1619
#if CoreCLR
1720
using System.Runtime.Loader;
1821
#else

src/PowerShellEditorServices/Hosting/EditorServicesServerFactory.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT License.
33

44
using System;
5-
using System.Diagnostics;
65
using System.IO;
76
using Microsoft.Extensions.DependencyInjection;
87
using Microsoft.Extensions.Logging;
@@ -14,6 +13,7 @@
1413
using Microsoft.PowerShell.EditorServices.Services.Extension;
1514

1615
#if DEBUG
16+
using System.Diagnostics;
1717
using Serilog.Debugging;
1818
#endif
1919

src/PowerShellEditorServices/Services/PowerShell/Context/PowerShellContextFrame.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33

44
using System;
55
using System.Diagnostics;
6-
using System.Text;
76
using Microsoft.Extensions.Logging;
87
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Runspace;
98
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility;
109
using SMA = System.Management.Automation;
1110

11+
#if DEBUG
12+
using System.Text;
13+
#endif
14+
1215
namespace Microsoft.PowerShell.EditorServices.Services.PowerShell.Context
1316
{
1417
[DebuggerDisplay("{ToDebuggerDisplayString()}")]

0 commit comments

Comments
 (0)