|
| 1 | +# Code analysis rules and configuration |
| 2 | + |
| 3 | +root = false |
| 4 | + |
| 5 | +# Code files |
| 6 | +[*.cs] |
| 7 | + |
| 8 | +# Globalization rules |
| 9 | + |
| 10 | +# CA1303: Do not pass literals as localized parameters |
| 11 | +dotnet_diagnostic.CA1303.severity = none |
| 12 | + |
| 13 | +# CA1304: Specify CultureInfo |
| 14 | +dotnet_diagnostic.CA1304.severity = error |
| 15 | + |
| 16 | +# CA1305: Specify IFormatProvider |
| 17 | +dotnet_diagnostic.CA1305.severity = none |
| 18 | + |
| 19 | +# CA1307: Specify StringComparison for clarity |
| 20 | +dotnet_diagnostic.CA1307.severity = none |
| 21 | + |
| 22 | +# CA1308: Normalize strings to uppercase |
| 23 | +dotnet_diagnostic.CA1308.severity = none |
| 24 | + |
| 25 | +# CA1309: Use ordinal stringcomparison |
| 26 | +dotnet_diagnostic.CA1309.severity = error |
| 27 | + |
| 28 | +# CA1310: Specify StringComparison for correctness |
| 29 | +dotnet_diagnostic.CA1310.severity = error |
| 30 | + |
| 31 | +# CA2101: Specify marshaling for P/Invoke string arguments |
| 32 | +dotnet_diagnostic.CA2101.severity = error |
| 33 | + |
| 34 | +# Reliability Rules |
| 35 | + |
| 36 | +# CA2000: Dispose objects before losing scope |
| 37 | +# Not reliable enough - false positives |
| 38 | +dotnet_diagnostic.CA2000.severity = suggestion |
| 39 | + |
| 40 | +# CA2002: Do not lock on objects with weak identity |
| 41 | +dotnet_diagnostic.CA2002.severity = error |
| 42 | + |
| 43 | +# CA2007: Consider calling ConfigureAwait on the awaited task |
| 44 | +dotnet_diagnostic.CA2007.severity = error |
| 45 | + |
| 46 | +# CA2008: Do not create tasks without passing a TaskScheduler |
| 47 | +dotnet_diagnostic.CA2008.severity = error |
| 48 | + |
| 49 | +# CA2009: Do not call ToImmutableCollection on an ImmutableCollection value |
| 50 | +dotnet_diagnostic.CA2009.severity = error |
| 51 | + |
| 52 | +# CA2011: Avoid infinite recursion |
| 53 | +dotnet_diagnostic.CA2011.severity = error |
| 54 | + |
| 55 | +# CA2012: Use ValueTasks correctly |
| 56 | +dotnet_diagnostic.CA2012.severity = error |
| 57 | + |
| 58 | +# CA2013: Do not use ReferenceEquals with value types |
| 59 | +dotnet_diagnostic.CA2013.severity = error |
| 60 | + |
| 61 | +# CA2014: Do not use stackalloc in loops |
| 62 | +dotnet_diagnostic.CA2014.severity = error |
| 63 | + |
| 64 | +# CA2015: Do not define finalizers for types derived from MemoryManager<T> |
| 65 | +dotnet_diagnostic.CA2015.severity = error |
| 66 | + |
| 67 | +# CA2016: Forward the 'CancellationToken' parameter to methods that take one |
| 68 | +dotnet_diagnostic.CA2016.severity = error |
0 commit comments