Skip to content

Commit 684be43

Browse files
authored
Remove deprecated fxcop analyzer (#1076)
1 parent 14682fc commit 684be43

File tree

23 files changed

+72
-187
lines changed

23 files changed

+72
-187
lines changed

.editorconfig

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,52 @@ csharp_preferred_modifier_order = public, private, protected, internal, static,
3939

4040
# IPY01: Parameter which is marked not nullable does not have the NotNullAttribute
4141
dotnet_diagnostic.IPY01.severity = warning
42+
43+
# Analyzers
44+
dotnet_analyzer_diagnostic.severity = warning
45+
dotnet_analyzer_diagnostic.category-style.severity = default
46+
47+
dotnet_diagnostic.CA1000.severity = none # CA1000: Do not declare static members on generic types
48+
dotnet_diagnostic.CA1001.severity = suggestion # CA1001: Types that own disposable fields should be disposable
49+
dotnet_diagnostic.CA1010.severity = suggestion # CA1010: Generic interface should also be implemented
50+
dotnet_diagnostic.CA1018.severity = suggestion # CA1018: Mark attributes with AttributeUsageAttribute
51+
dotnet_diagnostic.CA1036.severity = suggestion # CA1036: Override methods on comparable types
52+
dotnet_diagnostic.CA1051.severity = none # CA1051: Do not declare visible instance fields
53+
dotnet_diagnostic.CA1069.severity = suggestion # CA1069: Enums values should not be duplicated
54+
dotnet_diagnostic.CA1200.severity = suggestion # CA1200: Avoid using cref tags with a prefix
55+
dotnet_diagnostic.CA1304.severity = none # CA1304: Specify CultureInfo
56+
dotnet_diagnostic.CA1305.severity = none # CA1305: Specify IFormatProvider
57+
dotnet_diagnostic.CA1309.severity = suggestion # CA1309: Use ordinal string comparison
58+
dotnet_diagnostic.CA1310.severity = suggestion # CA1310: Specify StringComparison for correctness
59+
dotnet_diagnostic.CA1707.severity = none # CA1707: Identifiers should not contain underscores
60+
dotnet_diagnostic.CA1708.severity = none # CA1708: Identifiers should differ by more than case
61+
dotnet_diagnostic.CA1710.severity = none # CA1710: Identifiers should have correct suffix
62+
dotnet_diagnostic.CA1711.severity = none # CA1711: Identifiers should not have incorrect suffix
63+
dotnet_diagnostic.CA1712.severity = none # CA1712: Do not prefix enum values with type name
64+
dotnet_diagnostic.CA1715.severity = none # CA1715: Identifiers should have correct prefix
65+
dotnet_diagnostic.CA1716.severity = none # CA1716: Identifiers should not match keywords
66+
dotnet_diagnostic.CA1720.severity = none # CA1720: Identifier contains type name
67+
dotnet_diagnostic.CA1725.severity = suggestion # CA1725: Parameter names should match base declaration
68+
dotnet_diagnostic.CA1805.severity = suggestion # CA1805: Do not initialize unnecessarily
69+
dotnet_diagnostic.CA1806.severity = none # CA1806: Do not ignore method results
70+
dotnet_diagnostic.CA1816.severity = suggestion # CA1816: Dispose methods should call SuppressFinalize
71+
dotnet_diagnostic.CA1822.severity = none # CA1822: Mark members as static
72+
dotnet_diagnostic.CA1830.severity = suggestion # CA1830: Prefer strongly-typed Append and Insert method overloads on StringBuilder
73+
dotnet_diagnostic.CA1834.severity = suggestion # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
74+
dotnet_diagnostic.CA1837.severity = suggestion # CA1837: Use 'Environment.ProcessId'
75+
dotnet_diagnostic.CA1838.severity = suggestion # CA1838: Avoid 'StringBuilder' parameters for P/Invokes
76+
dotnet_diagnostic.CA2101.severity = suggestion # CA2101: Specify marshaling for P/Invoke string arguments
77+
dotnet_diagnostic.CA2201.severity = none # CA2201: Do not raise reserved exception types
78+
dotnet_diagnostic.CA2208.severity = suggestion # CA2208: Instantiate argument exceptions correctly
79+
dotnet_diagnostic.CA2211.severity = none # CA2211: Non-constant fields should not be visible
80+
dotnet_diagnostic.CA2219.severity = suggestion # CA2219: Do not raise exceptions in finally clauses
81+
dotnet_diagnostic.CA2229.severity = suggestion # CA2229: Implement serialization constructors
82+
dotnet_diagnostic.CA2249.severity = suggestion # CA2249: Consider using 'string.Contains' instead of 'string.IndexOf'
83+
dotnet_diagnostic.CA3075.severity = suggestion # CA3075: Insecure DTD processing in XML
84+
dotnet_diagnostic.CA5350.severity = suggestion # CA5350: Do Not Use Weak Cryptographic Algorithms
85+
dotnet_diagnostic.CA5351.severity = suggestion # CA5351: Do Not Use Broken Cryptographic Algorithms
86+
dotnet_diagnostic.CA5359.severity = suggestion # CA5359: Do Not Disable Certificate Validation
87+
dotnet_diagnostic.CA5372.severity = suggestion # CA5372: Use XmlReader For XPathDocument
88+
89+
# TODO: remove this
90+
dotnet_diagnostic.CA1825.severity = suggestion # CA1825: Avoid zero-length array allocations

Build/steps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ steps:
2525
displayName: Grab Package Version
2626
2727
- task: UseDotNet@2
28-
displayName: Install .NET Core 2.1 runtime for running tests
28+
displayName: Install .NET Core 2.1 runtime for testing
2929
inputs:
3030
packageType: 'runtime'
3131
version: '2.1.x'
3232

3333
- task: UseDotNet@2
34-
displayName: Install .NET Core 3.1 runtime for running tests
34+
displayName: Install .NET Core 3.1 runtime for testing
3535
inputs:
3636
packageType: 'runtime'
3737
version: '3.1.x'

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@
109109
<WarningLevel>4</WarningLevel>
110110
<PlatformTarget>AnyCPU</PlatformTarget>
111111
<Prefer32Bit>false</Prefer32Bit>
112-
<RunCodeAnalysis Condition="'$(Configuration)' == 'FxCop'">true</RunCodeAnalysis>
113112
<LangVersion>latest</LangVersion>
113+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
114114
</PropertyGroup>
115115

116116
<!-- Release -->

IronPython.ruleset

Lines changed: 0 additions & 89 deletions
This file was deleted.

IronPythonAnalyzer/IronPythonAnalyzer/IronPythonAnalyzer.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.1" PrivateAssets="all" />
9-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.7.0" PrivateAssets="all" />
8+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2" PrivateAssets="all" />
9+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.8.0" PrivateAssets="all" />
1010
</ItemGroup>
1111

1212
</Project>

Src/IronPython.Modules/IronPython.Modules.csproj

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<PropertyGroup>
44
<TargetFrameworks>net46;netcoreapp2.1;netcoreapp3.1;netstandard2.0;net5.0</TargetFrameworks>
55
<BaseAddress>885063680</BaseAddress>
6-
<CodeAnalysisRuleSet>..\..\IronPython.ruleset</CodeAnalysisRuleSet>
76
<GenerateDocumentationFile>true</GenerateDocumentationFile>
87
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
98
</PropertyGroup>
@@ -23,15 +22,7 @@
2322
</ItemGroup>
2423

2524
<ItemGroup>
26-
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0">
27-
<PrivateAssets>all</PrivateAssets>
28-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
29-
</PackageReference>
3025
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
31-
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8">
32-
<PrivateAssets>all</PrivateAssets>
33-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
34-
</PackageReference>
3526
</ItemGroup>
3627

3728
<ItemGroup Condition=" '$(TargetFramework)' != 'net46' ">

Src/IronPython.SQLite/IronPython.SQLite.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
</ItemGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0">
26-
<PrivateAssets>all</PrivateAssets>
27-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
28-
</PackageReference>
2925
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
3026
</ItemGroup>
3127

Src/IronPython.SQLite/c#sqlite/vdbeaux_c.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1896,7 +1896,7 @@ static void sqlite3VdbePrintSql( Vdbe p )
18961896
{
18971897
string z = pOp.p4.z;
18981898
z = z.Trim();// while ( sqlite3Isspace( *(u8)z ) ) z++;
1899-
Console.Write( "SQL: [%s]\n", z );
1899+
Console.Write( "SQL: [{0}]\n", z );
19001900
}
19011901
}
19021902
#endif

Src/IronPython/IronPython.csproj

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<PropertyGroup>
44
<TargetFrameworks>net46;netcoreapp2.1;netcoreapp3.1;netstandard2.0;net5.0</TargetFrameworks>
55
<BaseAddress>879755264</BaseAddress>
6-
<CodeAnalysisRuleSet>..\..\IronPython.ruleset</CodeAnalysisRuleSet>
76
<GenerateDocumentationFile>true</GenerateDocumentationFile>
87
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
98
</PropertyGroup>
@@ -50,15 +49,7 @@
5049
</ItemGroup>
5150

5251
<ItemGroup>
53-
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0">
54-
<PrivateAssets>all</PrivateAssets>
55-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
56-
</PackageReference>
5752
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
58-
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8">
59-
<PrivateAssets>all</PrivateAssets>
60-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
61-
</PackageReference>
6253
<PackageReference Include="Nullable" Version="1.3.0">
6354
<PrivateAssets>all</PrivateAssets>
6455
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

0 commit comments

Comments
 (0)