-
Notifications
You must be signed in to change notification settings - Fork 734
/
.globalconfig
152 lines (103 loc) · 5.43 KB
/
.globalconfig
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
is_global = true
# RS0030: Do not used banned APIs
# https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/BannedApiAnalyzers.Help.md
dotnet_diagnostic.RS0030.severity = error
dotnet_analyzer_diagnostic.category-Performance.severity = error
# CA1044: Properties should not be write only
dotnet_diagnostic.CA1044.severity = error
# CA1304: Specify CultureInfo
dotnet_diagnostic.CA1304.severity = error
# CA1305: Specify IFormatProvider
dotnet_diagnostic.CA1305.severity = error
# When we have interpolated string handlers (.NET 6+), there is an overload that accepts IFormatProvider.
# However, the same code is targeting older versions that only have `Append(string)` and no overload accepting IFormatProvider.
# Fixing the warning in this case will require noisy `#if` directives. We exclude this overload for now and get no warning at all.
dotnet_code_quality.CA1305.excluded_symbol_names = M:System.Text.StringBuilder.Append(System.Text.StringBuilder.AppendInterpolatedStringHandler@)|M:System.Text.StringBuilder.AppendLine(System.Text.StringBuilder.AppendInterpolatedStringHandler@)
# CA1805: Do not initialize unnecessarily
dotnet_diagnostic.CA1805.severity = error
# CA1815: Override equals and operator equals on value types
dotnet_diagnostic.CA1815.severity = error
# CA1821: Remove empty Finalizers
dotnet_diagnostic.CA1821.severity = error
# CA1821: Remove empty Finalizers
dotnet_diagnostic.CA1823.severity = error
# CA1825: Avoid zero-length array allocations
dotnet_diagnostic.CA1825.severity = error
# CA1826: Do not use Enumerable methods on indexable collections
dotnet_diagnostic.CA1826.severity = error
# CA1827: Do not use Count() or LongCount() when Any() can be used
dotnet_diagnostic.CA1827.severity = error
# CA1828: Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used
dotnet_diagnostic.CA1828.severity = error
# CA1829: Use Length/Count property instead of Count() when available
dotnet_diagnostic.CA1829.severity = error
# CA2200: Rethrow to preserve stack details
dotnet_diagnostic.CA2200.severity = error
# CA2211: Non-constant fields should not be visible
dotnet_diagnostic.CA2211.severity = error
# CA2218: Override GetHashCode on overriding Equals
dotnet_diagnostic.CA2218.severity = error
# CA1802: Use literals where appropriate
dotnet_diagnostic.CA1802.severity = none
# CA1806: Do not ignore method results
dotnet_diagnostic.CA1806.severity = error
# CA1810: Initialize reference type static fields inline
dotnet_diagnostic.CA1810.severity = none
# CA1812: Avoid uninstantiated internal classes
dotnet_diagnostic.CA1812.severity = none
# CA1813: Avoid unsealed attributes
dotnet_diagnostic.CA1813.severity = none
# CA1819: Properties should not return arrays
dotnet_diagnostic.CA1819.severity = none
# CA1820: Test for empty strings using string length
dotnet_diagnostic.CA1820.severity = none
# CA1822: Mark members as static
dotnet_diagnostic.CA1822.severity = none
# CA1823: Avoid unused private fields
dotnet_diagnostic.CA1823.severity = none
# CA1835: Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync'
dotnet_diagnostic.CA1835.severity = none
# CA1838: Avoid 'StringBuilder' parameters for P/Invokes
dotnet_diagnostic.CA1838.severity = none
# CA1844: Provide memory-based overrides of async methods when subclassing 'Stream'
dotnet_diagnostic.CA1844.severity = none
# CA1846: Prefer 'AsSpan' over 'Substring'
dotnet_diagnostic.CA1846.severity = none
# CA1847: Use char literal for a single character lookup
dotnet_diagnostic.CA1847.severity = none
# CA1848: Use the LoggerMessage delegates
dotnet_diagnostic.CA1848.severity = none
# CA1849: Call async methods when in an async method
dotnet_diagnostic.CA1849.severity = none
# CA1850: Prefer static 'System.Security.Cryptography.SHA256.HashData' method over 'ComputeHash'
dotnet_diagnostic.CA1850.severity = none
# CA1851: Possible multiple enumerations of 'IEnumerable' collection.
dotnet_diagnostic.CA1851.severity = none
# CA1854: Prefer a 'TryGetValue' call over a Dictionary indexer access guarded by a 'ContainsKey'
dotnet_diagnostic.CA1854.severity = none
# CA1852: Type 'XX' can be sealed because
dotnet_diagnostic.CA1852.severity = none
# CA1859: Change return type of method 'XX' from 'XX' to 'XX' for improved performance
dotnet_diagnostic.CA1859.severity = none
# CA1860: Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance
dotnet_diagnostic.CA1860.severity = none
# CA1863: Use composite format
# TODO: Enable when we are .NET 8+ to avoid conditional code between net7.0 and net8.0
dotnet_diagnostic.CA1863.severity = none
dotnet_code_quality.CA1822.api_surface = private, internal
# CA1303: Do not pass literals as localized parameters
dotnet_diagnostic.CA1303.severity = none
# CA1307: Specify StringComparison for clarity
dotnet_diagnostic.CA1307.severity = none
# CA1308: Normalize strings to uppercase
dotnet_diagnostic.CA1308.severity = none
# CA1309: Use ordinal StringComparison
dotnet_diagnostic.CA1309.severity = none
# CA2101: Specify marshalling for P/Invoke string arguments
dotnet_diagnostic.CA2101.severity = none
# IDE0005: Remove unnecessary using directives
dotnet_diagnostic.IDE0005.severity = none
# IDE0055: Fix formatting
dotnet_diagnostic.IDE0055.severity = warning # Will be promoted as an error by TreatWarningsAsErrors but also allows usage of WarningsNotAsErrors in debug
# IDE0051: Remove unused private member
dotnet_diagnostic.IDE0051.severity = warning