Skip to content

Commit d3e12d0

Browse files
Migrate from .ruleset to .editorconfig
1 parent 120154e commit d3e12d0

File tree

17 files changed

+160
-153
lines changed

17 files changed

+160
-153
lines changed

.editorconfig

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,70 @@ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
208208

209209

210210
# Errors and warnings
211+
dotnet_diagnostic.IDE0007.severity = none
212+
213+
dotnet_diagnostic.CA1001.severity = warning
214+
dotnet_diagnostic.CA1009.severity = warning
215+
dotnet_diagnostic.CA1016.severity = warning
216+
#dotnet_diagnostic.CA1033.severity = warning # Disabled because currently, there are too many violations
217+
dotnet_diagnostic.CA1049.severity = warning
218+
dotnet_diagnostic.CA1060.severity = warning
219+
dotnet_diagnostic.CA1061.severity = warning
220+
dotnet_diagnostic.CA1063.severity = warning
221+
dotnet_diagnostic.CA1065.severity = warning
222+
dotnet_diagnostic.CA1301.severity = warning
223+
dotnet_diagnostic.CA1400.severity = warning
224+
dotnet_diagnostic.CA1401.severity = warning
225+
dotnet_diagnostic.CA1403.severity = warning
226+
dotnet_diagnostic.CA1404.severity = warning
227+
dotnet_diagnostic.CA1405.severity = warning
228+
dotnet_diagnostic.CA1410.severity = warning
229+
dotnet_diagnostic.CA1415.severity = warning
230+
dotnet_diagnostic.CA1821.severity = warning
231+
dotnet_diagnostic.CA1900.severity = warning
232+
dotnet_diagnostic.CA1901.severity = warning
233+
dotnet_diagnostic.CA2002.severity = warning
234+
dotnet_diagnostic.CA2100.severity = warning
235+
dotnet_diagnostic.CA2101.severity = warning
236+
dotnet_diagnostic.CA2108.severity = warning
237+
dotnet_diagnostic.CA2111.severity = warning
238+
dotnet_diagnostic.CA2112.severity = warning
239+
dotnet_diagnostic.CA2114.severity = warning
240+
dotnet_diagnostic.CA2116.severity = warning
241+
dotnet_diagnostic.CA2117.severity = warning
242+
dotnet_diagnostic.CA2122.severity = warning
243+
dotnet_diagnostic.CA2123.severity = warning
244+
dotnet_diagnostic.CA2124.severity = warning
245+
dotnet_diagnostic.CA2126.severity = warning
246+
dotnet_diagnostic.CA2131.severity = warning
247+
dotnet_diagnostic.CA2132.severity = warning
248+
dotnet_diagnostic.CA2133.severity = warning
249+
dotnet_diagnostic.CA2134.severity = warning
250+
dotnet_diagnostic.CA2137.severity = warning
251+
dotnet_diagnostic.CA2138.severity = warning
252+
dotnet_diagnostic.CA2140.severity = warning
253+
dotnet_diagnostic.CA2141.severity = warning
254+
dotnet_diagnostic.CA2146.severity = warning
255+
dotnet_diagnostic.CA2147.severity = warning
256+
dotnet_diagnostic.CA2149.severity = warning
257+
dotnet_diagnostic.CA2200.severity = warning
258+
dotnet_diagnostic.CA2202.severity = warning
259+
dotnet_diagnostic.CA2207.severity = warning
260+
dotnet_diagnostic.CA2212.severity = warning
261+
dotnet_diagnostic.CA2213.severity = warning
262+
dotnet_diagnostic.CA2214.severity = warning
263+
dotnet_diagnostic.CA2216.severity = warning
264+
dotnet_diagnostic.CA2220.severity = warning
265+
dotnet_diagnostic.CA2229.severity = warning
266+
dotnet_diagnostic.CA2231.severity = warning
267+
dotnet_diagnostic.CA2232.severity = warning
268+
dotnet_diagnostic.CA2235.severity = warning
269+
dotnet_diagnostic.CA2236.severity = warning
270+
dotnet_diagnostic.CA2237.severity = warning
271+
dotnet_diagnostic.CA2238.severity = warning
272+
dotnet_diagnostic.CA2240.severity = warning
273+
dotnet_diagnostic.CA2241.severity = warning
274+
dotnet_diagnostic.CA2242.severity = warning
211275

212276
# MEF006: No importing constructor
213277
dotnet_diagnostic.MEF006.severity = silent

BuildTools/bom-strip.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $Dotfiles = @(
2929
$AllowedExts = @(
3030
'.bat','.config','.cs','.csproj','.css','.filelist','.fs','.html','.il',
3131
'.ipynb','.js','.json','.less','.manifest','.md','.projitems','.props',
32-
'.ps1','.psd1','.ruleset','.shproj','.sln','.slnf','.svg','.template',
32+
'.ps1','.psd1','.shproj','.sln','.slnf','.svg','.template',
3333
'.tt', '.txt','.vb','.vsct','.vsixlangpack','.wxl','.xaml','.xml','.xshd','.yml'
3434
)
3535

Directory.Packages.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,9 @@
5757
</ItemGroup>
5858
<ItemGroup>
5959
<GlobalPackageReference Include="TomsToolbox.Composition.Analyzer" Version="2.22.2" />
60+
<GlobalPackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="10.0.100">
61+
<PrivateAssets>all</PrivateAssets>
62+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
63+
</GlobalPackageReference>
6064
</ItemGroup>
6165
</Project>

ICSharpCode.BamlDecompiler/ICSharpCode.BamlDecompiler.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>net10.0</TargetFramework>
@@ -47,10 +47,6 @@
4747
<RestoreLockedMode>true</RestoreLockedMode>
4848
</PropertyGroup>
4949

50-
<ItemGroup>
51-
<Compile Remove="Properties\AssemblyInfo.template.cs" />
52-
</ItemGroup>
53-
5450
<ItemGroup>
5551
<Compile Remove="Baml\KnownThings.gen.cs" />
5652
</ItemGroup>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#region Using directives
2+
3+
using System.Diagnostics.CodeAnalysis;
4+
using System.Reflection;
5+
using System.Runtime.InteropServices;
6+
7+
#endregion
8+
9+
[assembly: AssemblyTrademark("")]
10+
[assembly: AssemblyCulture("")]
11+
12+
// This sets the default COM visibility of types in the assembly to invisible.
13+
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
14+
[assembly: ComVisible(false)]
15+
16+
[assembly: AssemblyVersion(DecompilerVersionInfo.Major + "." + DecompilerVersionInfo.Minor + "." + DecompilerVersionInfo.Build + "." + DecompilerVersionInfo.Revision)]
17+
[assembly: AssemblyInformationalVersion(DecompilerVersionInfo.FullVersionWithCommitHash)]
18+
19+
[assembly: SuppressMessage("Microsoft.Usage", "CA2243:AttributeStringLiteralsShouldParseCorrectly",
20+
Justification = "AssemblyInformationalVersion does not need to be a parsable version")]
21+

ICSharpCode.BamlDecompiler/packages.lock.json

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
"version": 2,
33
"dependencies": {
44
"net10.0": {
5+
"Microsoft.CodeAnalysis.NetAnalyzers": {
6+
"type": "Direct",
7+
"requested": "[10.0.100, )",
8+
"resolved": "10.0.100",
9+
"contentHash": "uj9VuyvqylnNueJfU7u2PkI/hEMpZl8Wg9BXyI0eatNEldU5jDYPdwsM8aDL18+1oLovju25MiqOPaGRBnG72A=="
10+
},
511
"Microsoft.Sbom.Targets": {
612
"type": "Direct",
713
"requested": "[4.1.4, )",
@@ -15,23 +21,7 @@
1521
"contentHash": "7gYo8ZR2eq3XkrilvUpLbTypeZy6IlD5FB8jah0YPhMOmDGhya4jJ3kfDMTTRt5m258Ou78P69mHMkG6DKZXsg=="
1622
},
1723
"icsharpcode.decompiler": {
18-
"type": "Project",
19-
"dependencies": {
20-
"System.Collections.Immutable": "[9.0.0, )",
21-
"System.Reflection.Metadata": "[9.0.0, )"
22-
}
23-
},
24-
"System.Collections.Immutable": {
25-
"type": "CentralTransitive",
26-
"requested": "[10.0.1, )",
27-
"resolved": "9.0.0",
28-
"contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w=="
29-
},
30-
"System.Reflection.Metadata": {
31-
"type": "CentralTransitive",
32-
"requested": "[10.0.1, )",
33-
"resolved": "9.0.0",
34-
"contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ=="
24+
"type": "Project"
3525
}
3626
}
3727
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# We disable some of the rules that don't make sense in our test
2+
[*.cs]
3+
dotnet_diagnostic.CA1060.severity = none
4+
dotnet_diagnostic.CA1063.severity = none
5+
dotnet_diagnostic.CA1065.severity = none
6+
dotnet_diagnostic.CA1401.severity = none
7+
dotnet_diagnostic.CA1821.severity = none
8+
dotnet_diagnostic.CA2002.severity = none
9+
dotnet_diagnostic.CA2101.severity = none
10+
dotnet_diagnostic.CA2241.severity = none
11+
dotnet_diagnostic.CA2263.severity = none # disable because it's choking on our test code in UndocumentedExpressions.cs

ICSharpCode.Decompiler.Tests/Helpers/RoslynToolset.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636

3737
namespace ICSharpCode.Decompiler.Tests.Helpers
3838
{
39+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1001:Types that own disposable fields should be disposable",
40+
Justification = "Derived types are intended to be used as static singletons, each living until the process terminates.")]
3941
abstract class AbstractToolset
4042
{
4143
readonly SourceCacheContext cache;

ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
<Compile Include="Output\InsertParenthesesVisitorTests.cs" />
148148
<Compile Include="ProjectDecompiler\TargetFrameworkTests.cs" />
149149
<Compile Include="ProjectDecompiler\WholeProjectDecompilerTests.cs" />
150+
<Compile Include="Properties\AssemblyInfo.cs" />
150151
<Compile Include="TestAssemblyResolver.cs" />
151152
<Compile Include="TestCases\ILPretty\ExtensionEncodingV2.cs" />
152153
<Compile Include="TestCases\ILPretty\ExtensionEncodingV1.cs" />
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#region Using directives
2+
3+
using System.Diagnostics.CodeAnalysis;
4+
using System.Reflection;
5+
using System.Runtime.InteropServices;
6+
7+
#endregion
8+
9+
[assembly: AssemblyTrademark("")]
10+
[assembly: AssemblyCulture("")]
11+
12+
// This sets the default COM visibility of types in the assembly to invisible.
13+
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
14+
[assembly: ComVisible(false)]
15+
16+
[assembly: AssemblyVersion(DecompilerVersionInfo.Major + "." + DecompilerVersionInfo.Minor + "." + DecompilerVersionInfo.Build + "." + DecompilerVersionInfo.Revision)]
17+
[assembly: AssemblyInformationalVersion(DecompilerVersionInfo.FullVersionWithCommitHash)]
18+
19+
[assembly: SuppressMessage("Microsoft.Usage", "CA2243:AttributeStringLiteralsShouldParseCorrectly",
20+
Justification = "AssemblyInformationalVersion does not need to be a parsable version")]
21+

0 commit comments

Comments
 (0)