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
Copy file name to clipboardExpand all lines: docs/core/tools/dotnet-format.md
+28-4Lines changed: 28 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,25 +105,25 @@ The `dotnet format style` subcommand only runs formatting rules associated with
105
105
106
106
***`--diagnostics <DIAGNOSTICS>`**
107
107
108
-
A space-separated list of diagnostic IDs to use as a filter when fixing code style or third-party issues. Default value is whichever IDs are listed in the *.editorconfig* file. For a list of built-in analyzer rule IDs that you can specify, see the [list of IDs for code-analysis style rules](../../fundamentals/code-analysis/style-rules/index.md).
108
+
A space-separated list of diagnostic IDs to use as a filter when fixing code style issues. Default value is whichever IDs are listed in the *.editorconfig* file. For a list of built-in code style analyzer rule IDs that you can specify, see the [list of IDs for code-analysis style rules](../../fundamentals/code-analysis/style-rules/index.md).
109
109
110
110
***`--severity`**
111
111
112
112
The minimum severity of diagnostics to fix. Allowed values are `info`, `warn`, and `error`. The default value is `warn`
113
113
114
114
### Analyzers
115
115
116
-
`dotnet format analyzers` - Formats code to match `editorconfig` settings for analyzers.
116
+
`dotnet format analyzers` - Formats code to match `editorconfig` settings for analyzers (excluding code style rules).
117
117
118
118
#### Description
119
119
120
-
The `dotnet format analyzers` subcommand only runs formatting rules associated with analyzers. For a list of analyzer rules that you can specify in your `editorconfig` file, see [Code style rules](../../fundamentals/code-analysis/style-rules/index.md).
120
+
The `dotnet format analyzers` subcommand only runs formatting rules associated with analyzers. For a list of analyzer rules that you can specify in your `editorconfig` file, see [Quality rules](../../fundamentals/code-analysis/quality-rules/index.md).
121
121
122
122
##### Options
123
123
124
124
***`--diagnostics <DIAGNOSTICS>`**
125
125
126
-
A space-separated list of diagnostic IDs to use as a filter when fixing code style or third-party issues. Default value is whichever IDs are listed in the *.editorconfig* file. For a list of built-in analyzer rule IDs that you can specify, see the [list of IDs for code-analysis style rules](../../fundamentals/code-analysis/style-rules/index.md).
126
+
A space-separated list of diagnostic IDs to use as a filter when fixing non code style issues. Default value is whichever IDs are listed in the *.editorconfig* file. For a list of built-in analyzer rule IDs that you can specify, see the [list of IDs for quality rules](../../fundamentals/code-analysis/quality-rules/index.md). For third-party analyzers refer to their documentation.
127
127
128
128
***`--severity`**
129
129
@@ -154,3 +154,27 @@ The `dotnet format analyzers` subcommand only runs formatting rules associated w
154
154
```dotnetcli
155
155
dotnet format --include ./src/ ./tests/ --exclude ./src/submodule-a/
156
156
```
157
+
158
+
* Fix a specific **code style** issue:
159
+
160
+
```dotnetcli
161
+
dotnet format style --diagnostics IDE0005 --severity info
162
+
```
163
+
164
+
* Fix all **code style** issues that have severity `info`, `warning` or `error`:
165
+
166
+
```dotnetcli
167
+
dotnet format style --severity info
168
+
```
169
+
170
+
* Fix a specific (non code style) analyzer issue:
171
+
172
+
```dotnetcli
173
+
dotnet format analyzers --diagnostics CA1831 --severity warn
174
+
```
175
+
176
+
* Fix all non code style issues that have severity `info`, `warning` or `error`:
0 commit comments