Skip to content

Commit de15ce4

Browse files
committed
Use built-in (and up-to-date) .NET Analyzers
Since all our projects target the `Microsoft.NET.Sdk` we can use roslyn's built-in analyzers instead of the out-of-date package (we could update that instead, but this is the modern method).
1 parent 75bc4fb commit de15ce4

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

PowerShellEditorServices.Common.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@
1111
<RepositoryType>git</RepositoryType>
1212
<RepositoryUrl>https://github.com/PowerShell/PowerShellEditorServices</RepositoryUrl>
1313
<DebugType>portable</DebugType>
14+
<!-- See: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview -->
15+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
16+
<!-- TODO: Enable `EnforceCodeStyleInBuild` -->
1417
</PropertyGroup>
1518
</Project>

src/PowerShellEditorServices.Hosting/PowerShellEditorServices.Hosting.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131

3232
<ItemGroup>
3333
<ProjectReference Include="..\PowerShellEditorServices\PowerShellEditorServices.csproj" PrivateAssets="all" />
34-
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.2">
35-
<PrivateAssets>all</PrivateAssets>
36-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
37-
</PackageReference>
3834
</ItemGroup>
3935

4036
<ItemGroup Condition="'$(TargetFramework)'=='net461'">

src/PowerShellEditorServices/PowerShellEditorServices.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
32
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), PowerShellEditorServices.Common.props))\PowerShellEditorServices.Common.props" />
43

54
<PropertyGroup>

0 commit comments

Comments
 (0)