You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to disable all rules by default in my .editorconfig, then enable some rules specifically. Is this possible to do without having to list every rule to disable (that would also require me to maintain the .editorconfig file when updating if there are new analyzers)?
What I can do today :
[*.cs]
# Disable all Meziantou rules by default
dotnet_diagnostic.MA0001.severity = none
dotnet_diagnostic.MA0002.severity = none
dotnet_diagnostic.MA0003.severity = none
...
dotnet_diagnostic.MA0163.severity = none
dotnet_diagnostic.MA0164.severity = none
dotnet_diagnostic.MA0165.severity = none
# Enable Meziantou rules I want to use
dotnet_diagnostic.MA0042.severity = error
But instead I'd like to have something along:
[*.cs]
# Disable all Meziantou rules by default
dotnet_diagnostic.Meziantou.severity = none # This is not possible
# Enable Meziantou rules I want to use
dotnet_diagnostic.MA0042.severity = error
For instance, Roslynator offers to change the severity of all rules using:
This is not possible to use the same strategy as Roslynator as it would require changing the rule's categories, which is a breaking change. So, I choose a strategy similar to .NET. You can use the following property in the csproj to disable all rules by default.
I'd like to disable all rules by default in my
.editorconfig
, then enable some rules specifically. Is this possible to do without having to list every rule to disable (that would also require me to maintain the.editorconfig
file when updating if there are new analyzers)?What I can do today :
But instead I'd like to have something along:
For instance, Roslynator offers to change the severity of all rules using:
The text was updated successfully, but these errors were encountered: