Skip to content

Commit

Permalink
Add other rules without code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
roji committed Sep 20, 2020
1 parent f2727ca commit a8feeae
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rulesets/FxCop.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<Rule Id="CA1829" Action="None" /> <!-- Use Length/Count property instead of Count() when available -->
<Rule Id="CA2000" Action="None" /> <!-- Dispose objects before losing scope -->
<Rule Id="CA2002" Action="None" /> <!-- Do not lock on objects with weak identity -->
<Rule Id="CA2007" Action="Warning" /> <!-- Consider calling ConfigureAwait on the awaited task -->
<Rule Id="CA2007" Action="None" /> <!-- Consider calling ConfigureAwait on the awaited task -->
<Rule Id="CA2008" Action="None" /> <!-- Do not create tasks without passing a TaskScheduler -->
<Rule Id="CA2009" Action="None" /> <!-- Do not call ToImmutableCollection on an ImmutableCollection value -->
<Rule Id="CA2010" Action="None" /> <!-- Always consume the value returned by methods marked with PreserveSigAttribute -->
Expand Down
33 changes: 33 additions & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,62 @@ root = false

# Globalization rules

# CA1303: Do not pass literals as localized parameters
dotnet_diagnostic.CA1303.severity = none

# CA1304: Specify CultureInfo
dotnet_diagnostic.CA1304.severity = error

# CA1305: Specify IFormatProvider
dotnet_diagnostic.CA1305.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 = error

# CA1310: Specify StringComparison for correctness
dotnet_diagnostic.CA1310.severity = error

# CA2101: Specify marshaling for P/Invoke string arguments
dotnet_diagnostic.CA2101.severity = error

# Reliability Rules

# CA2000: Dispose objects before losing scope
# Not reliable enough - false positives
dotnet_diagnostic.CA2000.severity = suggestion

# CA2002: Do not lock on objects with weak identity
dotnet_diagnostic.CA2002.severity = error

# CA2007: Consider calling ConfigureAwait on the awaited task
dotnet_diagnostic.CA2007.severity = error

# CA2008: Do not create tasks without passing a TaskScheduler
dotnet_diagnostic.CA2008.severity = error

# CA2009: Do not call ToImmutableCollection on an ImmutableCollection value
dotnet_diagnostic.CA2009.severity = error

# CA2011: Avoid infinite recursion
dotnet_diagnostic.CA2011.severity = error

# CA2012: Use ValueTasks correctly
dotnet_diagnostic.CA2012.severity = error

# CA2013: Do not use ReferenceEquals with value types
dotnet_diagnostic.CA2013.severity = error

# CA2014: Do not use stackalloc in loops
dotnet_diagnostic.CA2014.severity = error

# CA2015: Do not define finalizers for types derived from MemoryManager<T>
dotnet_diagnostic.CA2015.severity = error

# CA2016: Forward the 'CancellationToken' parameter to methods that take one
dotnet_diagnostic.CA2016.severity = error

0 comments on commit a8feeae

Please sign in to comment.