diff --git a/.editorconfig b/.editorconfig index db3c7e5903..e7fa14bdf8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -127,10 +127,6 @@ dotnet_diagnostic.IDE0260.severity = suggestion dotnet_diagnostic.IDE0280.severity = error # Collection initialization can be simplified dotnet_diagnostic.IDE0305.severity = silent -# Add parentheses when necessary -dotnet_diagnostic.RCS1123.severity = silent -# Remove suffix 'Async' from non-asynchronous method name -dotnet_diagnostic.RCS1047.severity = silent # see #2888 csharp_style_var_when_type_is_apparent = true csharp_style_var_elsewhere = true diff --git a/.global.editorconfig.ini b/.global.editorconfig.ini index 3e193a4c94..b50d511f22 100644 --- a/.global.editorconfig.ini +++ b/.global.editorconfig.ini @@ -213,7 +213,7 @@ dotnet_diagnostic.MA0027.severity = error # Optimize StringBuilder usage dotnet_diagnostic.MA0028.severity = silent # Combine LINQ methods -dotnet_diagnostic.MA0029.severity = error +dotnet_diagnostic.MA0029.severity = error # redundant with IDE0120 # Remove useless OrderBy call dotnet_diagnostic.MA0030.severity = error # Optimize Enumerable.Count() usage @@ -239,7 +239,7 @@ dotnet_diagnostic.MA0041.severity = silent # Do not use blocking calls in an async method dotnet_diagnostic.MA0042.severity = silent # DoNotUseBlockingCallInAsyncContextAnalyzer very slow # Use nameof operator in ArgumentException -dotnet_diagnostic.MA0043.severity = error +dotnet_diagnostic.MA0043.severity = silent # redundant with CA1507 # Remove useless ToString call dotnet_diagnostic.MA0044.severity = warning # Do not use blocking call in a sync method (need to make containing method async) @@ -430,42 +430,126 @@ dotnet_diagnostic.MEN018.severity = warning ## Roslynator.Analyzers rules +# Use nameof operator +dotnet_diagnostic.RCS1015.severity = silent # redundant with CA1507 +# Remove redundant boolean literal +dotnet_diagnostic.RCS1033.severity = silent # redundant with IDE0100 +# Remove trailing white-space +dotnet_diagnostic.RCS1037.severity = silent # redundant with SA1028 # Remove 'partial' modifier from type with a single part dotnet_diagnostic.RCS1043.severity = warning +# Remove original exception from throw statement +dotnet_diagnostic.RCS1044.severity = silent # redundant with MA0027 +# Non-asynchronous method name should not end with 'Async' +dotnet_diagnostic.RCS1047.severity = silent # pending https://github.com/TASEmulators/BizHawk/issues/2888 +# Use lambda expression instead of anonymous method +dotnet_diagnostic.RCS1048.severity = silent # redundant with BHI1001 +# Simplify boolean comparison +dotnet_diagnostic.RCS1049.severity = silent # redundant with IDE0100 +# Use compound assignment +dotnet_diagnostic.RCS1058.severity = silent # redundant with IDE0054 # Avoid locking on publicly accessible instance dotnet_diagnostic.RCS1059.severity = silent # Avoid empty catch clause that catches System.Exception dotnet_diagnostic.RCS1075.severity = silent +# Optimize LINQ method call +dotnet_diagnostic.RCS1077.severity = silent # redundant with IDE0120 # Use 'Count/Length' property instead of 'Any' method dotnet_diagnostic.RCS1080.severity = error +# Use --/++ operator instead of assignment +dotnet_diagnostic.RCS1089.severity = silent # redundant with IDE0054 +# File contains no code +dotnet_diagnostic.RCS1093.severity = silent +# Remove redundant 'ToString' call +dotnet_diagnostic.RCS1097.severity = silent # redundant with MA0044 +# Constant values should be placed on right side of comparisons +dotnet_diagnostic.RCS1098.severity = silent # comes for free w/ pattern matching +# Default label should be the last label in a switch section +dotnet_diagnostic.RCS1099.severity = silent # Make class static dotnet_diagnostic.RCS1102.severity = silent +# Simplify conditional expression +dotnet_diagnostic.RCS1104.severity = silent # redundant with IDE0075 +# Declare type inside namespace +dotnet_diagnostic.RCS1110.severity = silent # redundant with MA0047 +# Combine 'Enumerable.Where' method chain +dotnet_diagnostic.RCS1112.severity = silent # redundant with MA0029 +# Add parentheses when necessary +dotnet_diagnostic.RCS1123.severity = silent +# Use coalesce expression +dotnet_diagnostic.RCS1128.severity = silent # redundant with IDE0074 # Bitwise operation on enum without Flags attribute dotnet_diagnostic.RCS1130.severity = error +# Declare enum member with zero value (when enum has FlagsAttribute) +dotnet_diagnostic.RCS1135.severity = silent # redundant with CA1008 # Add summary to documentation comment dotnet_diagnostic.RCS1138.severity = silent # Add summary element to documentation comment dotnet_diagnostic.RCS1139.severity = silent +# Use StringComparison when comparing strings +dotnet_diagnostic.RCS1155.severity = silent # redundant with CA1862 # Use string.Length instead of comparison with empty string dotnet_diagnostic.RCS1156.severity = error # Composite enum value contains undefined flag dotnet_diagnostic.RCS1157.severity = warning +# Static member in generic type should use a type parameter +dotnet_diagnostic.RCS1158.severity = silent # redundant with CA1000/MA0018 +# Use EventHandler +dotnet_diagnostic.RCS1159.severity = silent # Abstract type should not have public constructors dotnet_diagnostic.RCS1160.severity = error +# Unused parameter +dotnet_diagnostic.RCS1163.severity = silent # redundant with IDE0060 +# Value type object is never equal to null +dotnet_diagnostic.RCS1166.severity = silent # redundant with CS0472 +# Make field read-only +dotnet_diagnostic.RCS1169.severity = silent # redundant with IDE0044 +# Use read-only auto-implemented property +dotnet_diagnostic.RCS1170.severity = silent # redundant with MEN017 +# Simplify lazy initialization +dotnet_diagnostic.RCS1171.severity = silent # redundant with IDE0074 +# Unused 'this' parameter +dotnet_diagnostic.RCS1175.severity = silent # redundant with IDE0060 +# Inline lazy initialization +dotnet_diagnostic.RCS1180.severity = silent # redundant with IDE0074 +# Use constant instead of field +dotnet_diagnostic.RCS1187.severity = silent # Declare enum value as combination of names dotnet_diagnostic.RCS1191.severity = warning +# Overriding member should not change 'params' modifier +dotnet_diagnostic.RCS1193.severity = silent # redundant with MA0081 # Implement exception constructors dotnet_diagnostic.RCS1194.severity = silent # Use ^ operator dotnet_diagnostic.RCS1195.severity = warning +# Use AttributeUsageAttribute +dotnet_diagnostic.RCS1203.severity = silent # redundant with MA0010 +# Use EventArgs.Empty +dotnet_diagnostic.RCS1204.severity = silent # redundant with MA0019 +# Order named arguments according to the order of parameters +dotnet_diagnostic.RCS1205.severity = silent +# Return completed task instead of returning null +dotnet_diagnostic.RCS1210.severity = silent # redundant with MA0022 +# Remove unused member declaration +dotnet_diagnostic.RCS1213.severity = silent # redundant with CS0414 +# Use pattern matching instead of combination of 'as' operator and null check +dotnet_diagnostic.RCS1221.severity = silent # redundant with IDE0019 +# Merge preprocessor directives +dotnet_diagnostic.RCS1222.severity = silent # Make method an extension method dotnet_diagnostic.RCS1224.severity = warning +# Make class sealed +dotnet_diagnostic.RCS1225.severity = silent # Add paragraph to documentation comment dotnet_diagnostic.RCS1226.severity = warning # Validate arguments correctly dotnet_diagnostic.RCS1227.severity = error # Use async/await when necessary dotnet_diagnostic.RCS1229.severity = error +# Order elements in documentation comment +dotnet_diagnostic.RCS1232.severity = silent +# Duplicate enum value +dotnet_diagnostic.RCS1234.severity = silent # Use exception filter dotnet_diagnostic.RCS1236.severity = warning # Operator is unnecessary @@ -476,16 +560,26 @@ dotnet_diagnostic.RCS1242.severity = silent dotnet_diagnostic.RCS1243.severity = warning # Use element access dotnet_diagnostic.RCS1246.severity = warning +# Fix documentation comment tag +dotnet_diagnostic.RCS1247.severity = silent # redundant with DOC203 # Unnecessary null-forgiving operator dotnet_diagnostic.RCS1249.severity = warning +# Normalize format of enum flag value +dotnet_diagnostic.RCS1254.severity = silent # Invalid argument null check dotnet_diagnostic.RCS1256.severity = error # Use enum field explicitly dotnet_diagnostic.RCS1257.severity = warning # Unnecessary enum flag dotnet_diagnostic.RCS1258.severity = warning +# Remove empty syntax +dotnet_diagnostic.RCS1259.severity = silent # `else`/`finally` redundant with MA0090, `;;` redundant with MA0037, obj. init. doesn't work, others useless # Resource can be disposed asynchronously dotnet_diagnostic.RCS1261.severity = error +# Unnecessary raw string literal +dotnet_diagnostic.RCS1262.severity = silent +# Invalid reference in a documentation comment +dotnet_diagnostic.RCS1263.severity = silent # redundant with CS1572 ## Microsoft.CodeAnalysis.BannedApiAnalyzers rules