-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrules.ruleset
104 lines (96 loc) · 7.25 KB
/
rules.ruleset
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?xml version="1.0"?>
<RuleSet Name="Documentation Rules with default action" Description="All Documentation Rules with default action. Rules with IsEnabledByDefault = false or from a different category are disabled." ToolsVersion="15.0">
<!-- Documentation Rules -->
<Rules AnalyzerId="Microsoft.CodeQuality.CSharp.Analyzers" RuleNamespace="Microsoft.CodeQuality.CSharp.Analyzers">
<Rule Id="CA1200" Action="Warning" /> <!-- Avoid using cref tags with a prefix -->
</Rules>
<!-- Globalization Rules -->
<Rules AnalyzerId="Microsoft.NetCore.Analyzers" RuleNamespace="Microsoft.NetCore.Analyzers">
<Rule Id="CA1304" Action="None" /> <!-- Specify CultureInfo -->
<Rule Id="CA1305" Action="None" /> <!-- Specify IFormatProvider -->
<Rule Id="CA1307" Action="None" /> <!-- Specify StringComparison -->
<Rule Id="CA1308" Action="None" /> <!-- Normalize strings to uppercase -->
<Rule Id="CA2101" Action="Warning" /> <!-- Specify marshaling for P/Invoke string arguments -->
</Rules>
<!-- Maintainability Rules -->
<Rules AnalyzerId="Microsoft.CodeQuality.Analyzers" RuleNamespace="Microsoft.CodeQuality.Analyzers">
<Rule Id="CA1501" Action="None" /> <!-- Avoid excessive inheritance -->
<Rule Id="CA1502" Action="None" /> <!-- Avoid excessive complexity -->
<Rule Id="CA1505" Action="None" /> <!-- Avoid unmaintainable code -->
<Rule Id="CA1506" Action="None" /> <!-- Avoid excessive class coupling -->
<Rule Id="CA1508" Action="None" /> <!-- Avoid dead conditional code -->
<Rule Id="CA1509" Action="None" /> <!-- Invalid entry in code metrics rule specification file -->
</Rules>
<Rules AnalyzerId="Microsoft.CodeQuality.CSharp.Analyzers" RuleNamespace="Microsoft.CodeQuality.CSharp.Analyzers">
<Rule Id="CA1507" Action="Warning" /> <!-- Use nameof to express symbol names -->
</Rules>
<!-- Performance Rules -->
<Rules AnalyzerId="Microsoft.CodeAnalysis.VersionCheckAnalyzer" RuleNamespace="Microsoft.CodeAnalysis.VersionCheckAnalyzer">
</Rules>
<Rules AnalyzerId="Microsoft.CodeQuality.Analyzers" RuleNamespace="Microsoft.CodeQuality.Analyzers">
<Rule Id="CA1802" Action="Warning" /> <!-- Use literals where appropriate -->
<Rule Id="CA1806" Action="Warning" /> <!-- Do not ignore method results -->
<Rule Id="CA1812" Action="Warning" /> <!-- Avoid uninstantiated internal classes -->
<Rule Id="CA1814" Action="Warning" /> <!-- Prefer jagged arrays over multidimensional -->
<Rule Id="CA1815" Action="Warning" /> <!-- Override equals and operator equals on value types -->
<Rule Id="CA1819" Action="Warning" /> <!-- Properties should not return arrays -->
<Rule Id="CA1823" Action="Warning" /> <!-- Avoid unused private fields -->
</Rules>
<Rules AnalyzerId="Microsoft.CodeQuality.CSharp.Analyzers" RuleNamespace="Microsoft.CodeQuality.CSharp.Analyzers">
<Rule Id="CA1821" Action="Warning" /> <!-- Remove empty Finalizers -->
</Rules>
<Rules AnalyzerId="Microsoft.NetCore.Analyzers" RuleNamespace="Microsoft.NetCore.Analyzers">
<Rule Id="CA1813" Action="None" /> <!-- Avoid unsealed attributes -->
<Rule Id="CA1820" Action="Warning" /> <!-- Test for empty strings using string length -->
<Rule Id="CA1826" Action="Warning" /> <!-- Do not use Enumerable methods on indexable collections. Instead use the collection directly -->
</Rules>
<Rules AnalyzerId="Microsoft.NetCore.CSharp.Analyzers" RuleNamespace="Microsoft.NetCore.CSharp.Analyzers">
<Rule Id="CA1810" Action="Warning" /> <!-- Initialize reference type static fields inline -->
<Rule Id="CA1824" Action="Warning" /> <!-- Mark assemblies with NeutralResourcesLanguageAttribute -->
<Rule Id="CA1825" Action="Warning" /> <!-- Avoid zero-length array allocations. -->
</Rules>
<!-- Reliability Rules -->
<Rules AnalyzerId="Microsoft.CodeQuality.Analyzers" RuleNamespace="Microsoft.CodeQuality.Analyzers">
<Rule Id="CA2007" Action="Warning" /> <!-- Consider calling ConfigureAwait on the awaited task -->
</Rules>
<Rules AnalyzerId="Microsoft.NetCore.Analyzers" RuleNamespace="Microsoft.NetCore.Analyzers">
<Rule Id="CA2000" Action="Warning" /> <!-- Dispose objects before losing scope -->
<Rule Id="CA2002" Action="Warning" /> <!-- Do not lock on objects with weak identity -->
<Rule Id="CA2008" Action="Warning" /> <!-- Do not create tasks without passing a TaskScheduler -->
<Rule Id="CA2009" Action="Warning" /> <!-- Do not call ToImmutableCollection on an ImmutableCollection value -->
</Rules>
<Rules AnalyzerId="Microsoft.NetCore.CSharp.Analyzers" RuleNamespace="Microsoft.NetCore.CSharp.Analyzers">
<Rule Id="CA2010" Action="Warning" /> <!-- Always consume the value returned by methods marked with PreserveSigAttribute -->
</Rules>
<!-- Other Rules -->
<Rules AnalyzerId="Microsoft.CodeAnalysis.VersionCheckAnalyzer" RuleNamespace="Microsoft.CodeAnalysis.VersionCheckAnalyzer">
<Rule Id="CA9999" Action="None" /> <!-- Analyzer version mismatch -->
</Rules>
<Rules AnalyzerId="Microsoft.CodeQuality.Analyzers" RuleNamespace="Microsoft.CodeQuality.Analyzers">
<Rule Id="IDE0003" Action="None" /> <!-- Name can be simplified. jfc VS is annoying -->
<Rule Id="CA1031" Action="None" /> <!-- Catch a more specific exception -->
<Rule Id="CA1707" Action="None" /> <!-- Don't have opinions on how things should be made thank you -->
<Rule Id="CA1068" Action="None" /> <!-- CancellationToken parameters must come last. -->
<Rule Id="CA1030" Action="None" /> <!-- Use events where appropriate. -->
<Rule Id="CA1303" Action="None" /> <!-- Do not pass literals as localized parameters. Unfortunately, Unity doesn't know how to generate resources from localizable resx files (and neither does dotnet core for some reason), so we don't have localization right now -->
<Rule Id="CA1716" Action="None" />
<Rule Id="CA1717" Action="None" />
<Rule Id="CA1032" Action="None" />
<Rule Id="CA1051" Action="None" />
<Rule Id="CA1062" Action="None" />
<Rule Id="CA2211" Action="None" />
<Rule Id="CA1721" Action="None" />
<Rule Id="CA2237" Action="None" />
<Rule Id="CA2229" Action="None" />
<Rule Id="CA1054" Action="None" />
<Rule Id="CA1067" Action="None" />
<Rule Id="CA1822" Action="None" />
<Rule Id="CA1018" Action="None" />
<Rule Id="CA1000" Action="None" />
<Rule Id="CA5351" Action="None" />
<Rule Id="CA1801" Action="None" /> <!-- analyser is broken and fires this rule on required Serialization methods -->
<Rule Id="CS1591" Action="None" /> <!-- supress documentation missing warnings for now -->
<Rule Id="CS0169" Action="None" /> <!-- don't warn on unused fields, they're for serialization -->
<Rule Id="CS0649" Action="None" /> <!-- don't warn on unused fields, they're for serialization -->
</Rules>
</RuleSet>