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
* In an .editorconfig file, which contains [rule severities](https://docs.microsoft.com/en-us/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2019#set-rule-severity-in-an-editorconfig-file):
59
+
60
+
```ini
61
+
root = true
62
+
63
+
[*.cs]
64
+
dotnet_diagnostic.av1115.severity = error
65
+
dotnet_diagnostic.av1130.severity = suggestion
66
+
```
67
+
58
68
* In a custom .ruleset file, which contains Code Analysis settings:
59
69
60
70
Right-click your project, select **Properties**, tab **Code Analysis**. Click **Open**, expand **CSharpGuidelinesAnalyzers** and uncheck the rules you want to disable. When you save changes, a .ruleset file is added to your project.
Editorconfig settings are inherited from parent directories (unless `root = true`), which enables you to vary rule configuration per directory.
15
+
Aside from rule-specific settings, you can set [severities](https://docs.microsoft.com/en-us/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2019#set-rule-severity-in-an-editorconfig-file) for all rules in this file too:
16
+
17
+
```ini
18
+
root = true
19
+
20
+
[*.cs]
21
+
dotnet_diagnostic.av1115.severity = error
22
+
dotnet_diagnostic.av1130.severity = suggestion
23
+
```
24
+
25
+
# Legacy configuration support
26
+
27
+
Note: The method described here still exists for compatibility with earlier versions (editorconfig takes precedence), but will be removed in a future version.
28
+
3
29
The behavior of rules can be customized by adding a file named `CSharpGuidelinesAnalyzer.config` to your C# project with the following structure:
Copy file name to clipboardExpand all lines: src/CSharpGuidelinesAnalyzer/CSharpGuidelinesAnalyzer.Test/Specs/Maintainability/AvoidMemberWithManyStatementsSpecs.cs
0 commit comments