Enable Net 7 and Net 8 style rules.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
71ae0aedfb
commit
cfde11556f
@@ -748,7 +748,7 @@ dotnet_diagnostic.CA1305.severity = warning
|
||||
dotnet_diagnostic.CA1310.severity = warning
|
||||
|
||||
# Specify a culture or use an invariant version.
|
||||
dotnet_diagnostic.CA1311.severity = suggestion # TODO: Change to warning once using .NET 7 or later.
|
||||
dotnet_diagnostic.CA1311.severity = warning
|
||||
|
||||
### Portability and Interoperability Rules
|
||||
### https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/interoperability-warnings
|
||||
@@ -763,19 +763,19 @@ dotnet_diagnostic.CA1417.severity = warning
|
||||
dotnet_diagnostic.CA1507.severity = warning
|
||||
|
||||
# Use ArgumentNullException throw helper.
|
||||
dotnet_diagnostic.CA1510.severity = suggestion # TODO: Change to warning once using .NET 7 or later.
|
||||
dotnet_diagnostic.CA1510.severity = warning
|
||||
|
||||
# Use ArgumentException throw helper.
|
||||
dotnet_diagnostic.CA1511.severity = suggestion # TODO: Change to warning once using .NET 7 or later.
|
||||
dotnet_diagnostic.CA1511.severity = warning
|
||||
|
||||
# Use ArgumentOutOfRangeException throw helper.
|
||||
dotnet_diagnostic.CA1512.severity = suggestion # TODO: Change to warning once using .NET 8 or later.
|
||||
dotnet_diagnostic.CA1512.severity = warning
|
||||
|
||||
# Use ObjectDisposedException throw helper.
|
||||
dotnet_diagnostic.CA1513.severity = suggestion # TODO: Change to warning once using .NET 7 or later.
|
||||
dotnet_diagnostic.CA1513.severity = warning
|
||||
|
||||
# Avoid redundant length argument.
|
||||
dotnet_diagnostic.CA1514.severity = suggestion # TODO: Change to warning once using .NET 8 or later.
|
||||
dotnet_diagnostic.CA1514.severity = warning
|
||||
|
||||
### Naming Rules
|
||||
### https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/naming-warnings
|
||||
@@ -868,8 +868,8 @@ dotnet_diagnostic.CA1843.severity = warning
|
||||
# Provide memory-based overrides of async methods when subclassing 'Stream'.
|
||||
dotnet_diagnostic.CA1844.severity = warning
|
||||
|
||||
# Use span-based 'string.Concat'. (Not available on mono)
|
||||
dotnet_diagnostic.CA1845.severity = none
|
||||
# Use span-based 'string.Concat'.
|
||||
dotnet_diagnostic.CA1845.severity = warning
|
||||
|
||||
# Prefer AsSpan over Substring.
|
||||
dotnet_diagnostic.CA1846.severity = warning
|
||||
@@ -878,34 +878,34 @@ dotnet_diagnostic.CA1846.severity = warning
|
||||
dotnet_diagnostic.CA1847.severity = warning
|
||||
|
||||
# Call async methods when in an async method.
|
||||
dotnet_diagnostic.CA1849.severity = suggestion # TODO: Change to warning once using .NET 7 or later.
|
||||
dotnet_diagnostic.CA1849.severity = warning
|
||||
|
||||
# Prefer static HashData method over ComputeHash. (Not available on mono)
|
||||
dotnet_diagnostic.CA1850.severity = none # TODO: Change to warning once using .NET 7 or later AND once supported by mono.
|
||||
# Prefer static HashData method over ComputeHash.
|
||||
dotnet_diagnostic.CA1850.severity = warning
|
||||
|
||||
# Possible multiple enumerations of IEnumerable collection.
|
||||
#dotnet_code_quality.CA1851.enumeration_methods =
|
||||
dotnet_code_quality.CA1851.linq_chain_methods = M:OpenRA.Traits.IRenderModifier.Modify*
|
||||
dotnet_code_quality.CA1851.assume_method_enumerates_parameters = true
|
||||
dotnet_diagnostic.CA1851.severity = suggestion # TODO: Change to warning once using .NET 7 or later.
|
||||
dotnet_diagnostic.CA1851.severity = warning
|
||||
|
||||
# Seal internal types.
|
||||
dotnet_diagnostic.CA1852.severity = suggestion # TODO: Change to warning once using .NET 7 or later.
|
||||
dotnet_diagnostic.CA1852.severity = warning
|
||||
|
||||
# Unnecessary call to 'Dictionary.ContainsKey(key)'.
|
||||
dotnet_diagnostic.CA1853.severity = suggestion # TODO: Change to warning once using .NET 7 or later.
|
||||
dotnet_diagnostic.CA1853.severity = warning
|
||||
|
||||
# Prefer the IDictionary.TryGetValue(TKey, out TValue) method.
|
||||
dotnet_diagnostic.CA1854.severity = suggestion # TODO: Change to warning once using .NET 7 or later.
|
||||
dotnet_diagnostic.CA1854.severity = warning
|
||||
|
||||
# Use Span<T>.Clear() instead of Span<T>.Fill().
|
||||
dotnet_diagnostic.CA1855.severity = suggestion # TODO: Change to warning once using .NET 7 or later.
|
||||
dotnet_diagnostic.CA1855.severity = warning
|
||||
|
||||
# Incorrect usage of ConstantExpected attribute.
|
||||
dotnet_diagnostic.CA1856.severity = suggestion # TODO: Change to warning once using .NET 7 or later.
|
||||
dotnet_diagnostic.CA1856.severity = warning
|
||||
|
||||
# The parameter expects a constant for optimal performance.
|
||||
dotnet_diagnostic.CA1857.severity = suggestion # TODO: Change to warning once using .NET 7 or later.
|
||||
dotnet_diagnostic.CA1857.severity = warning
|
||||
|
||||
# Use StartsWith instead of IndexOf.
|
||||
dotnet_diagnostic.CA1858.severity = warning
|
||||
@@ -917,24 +917,24 @@ dotnet_diagnostic.CA1860.severity = warning
|
||||
dotnet_diagnostic.CA1862.severity = warning
|
||||
|
||||
# Use 'CompositeFormat'.
|
||||
dotnet_diagnostic.CA1863.severity = suggestion # TODO: Change to warning once using .NET 7 or later.
|
||||
dotnet_diagnostic.CA1863.severity = warning
|
||||
|
||||
# Prefer the 'IDictionary.TryAdd(TKey, TValue)' method.
|
||||
dotnet_diagnostic.CA1864.severity = suggestion # TODO: Change to warning once using .NET 8 or later.
|
||||
dotnet_diagnostic.CA1864.severity = warning
|
||||
|
||||
# Use 'string.Method(char)' instead of 'string.Method(string)' for string with single char.
|
||||
dotnet_diagnostic.CA1865.severity = suggestion # TODO: Change to warning once using .NET 8 or later.
|
||||
dotnet_diagnostic.CA1866.severity = suggestion # TODO: Change to warning once using .NET 8 or later.
|
||||
dotnet_diagnostic.CA1867.severity = suggestion # TODO: Change to warning once using .NET 8 or later.
|
||||
dotnet_diagnostic.CA1865.severity = warning
|
||||
dotnet_diagnostic.CA1866.severity = warning
|
||||
dotnet_diagnostic.CA1867.severity = warning
|
||||
|
||||
# Unnecessary call to 'Contains' for sets.
|
||||
dotnet_diagnostic.CA1868.severity = suggestion # TODO: Change to warning once using .NET 8 or later.
|
||||
dotnet_diagnostic.CA1868.severity = warning
|
||||
|
||||
# Cache and reuse 'JsonSerializerOptions' instances.
|
||||
dotnet_diagnostic.CA1869.severity = suggestion # TODO: Change to warning once using .NET 8 or later.
|
||||
dotnet_diagnostic.CA1869.severity = warning
|
||||
|
||||
# Use a cached 'SearchValues' instance.
|
||||
dotnet_diagnostic.CA1870.severity = suggestion # TODO: Change to warning once using .NET 8 or later.
|
||||
dotnet_diagnostic.CA1870.severity = warning
|
||||
|
||||
# Do not pass a nullable struct to 'ArgumentNullException.ThrowIfNull'.
|
||||
dotnet_diagnostic.CA1871.severity = warning
|
||||
@@ -964,7 +964,7 @@ dotnet_diagnostic.CA2016.severity = warning
|
||||
dotnet_diagnostic.CA2018.severity = warning
|
||||
|
||||
# ThreadStatic fields should not use inline initialization.
|
||||
dotnet_diagnostic.CA2019.severity = suggestion # TODO: Change to warning once using .NET 7 or later.
|
||||
dotnet_diagnostic.CA2019.severity = warning
|
||||
|
||||
# Don't call Enumerable.Cast<T> or Enumerable.OfType<T> with incompatible types.
|
||||
dotnet_diagnostic.CA2021.severity = warning
|
||||
@@ -1041,10 +1041,10 @@ dotnet_diagnostic.CA2250.severity = warning
|
||||
dotnet_diagnostic.CA2251.severity = warning
|
||||
|
||||
# Ensure ThreadStatic is only used with static fields.
|
||||
dotnet_diagnostic.CA2259.severity = suggestion # TODO: Change to warning once using .NET 7 or later.
|
||||
dotnet_diagnostic.CA2259.severity = warning
|
||||
|
||||
# Prefer generic overload when type is known.
|
||||
dotnet_diagnostic.CA2263.severity = none # TODO: Change to warning once mono is dropped.
|
||||
dotnet_diagnostic.CA2263.severity = warning
|
||||
|
||||
# Do not pass a non-nullable value to 'ArgumentNullException.ThrowIfNull'.
|
||||
dotnet_diagnostic.CA2264.severity = warning
|
||||
|
||||
Reference in New Issue
Block a user