@@ -180,9 +180,10 @@ comments, which are treated equivalently to `# fmt: off` and `# fmt: on`, respec
180
180
181
181
Ruff's formatter is designed to be used alongside the linter. However, the linter includes
182
182
some rules that, when enabled, can cause conflicts with the formatter, leading to unexpected
183
- behavior.
183
+ behavior. When configured appropriately, the goal of Ruff's formatter-linter compatibility is
184
+ such that running the formatter should never introduce new lint errors.
184
185
185
- When using Ruff as a formatter, we recommend disabling the following rules:
186
+ As such, when using Ruff as a formatter, we recommend avoiding the following lint rules:
186
187
187
188
- [ ` tab-indentation ` ] ( rules/tab-indentation.md ) (` W191 ` )
188
189
- [ ` indentation-with-invalid-multiple ` ] ( rules/indentation-with-invalid-multiple.md ) (` E111 ` )
@@ -199,7 +200,11 @@ When using Ruff as a formatter, we recommend disabling the following rules:
199
200
- [ ` single-line-implicit-string-concatenation ` ] ( rules/single-line-implicit-string-concatenation.md ) (` ISC001 ` )
200
201
- [ ` multi-line-implicit-string-concatenation ` ] ( rules/multi-line-implicit-string-concatenation.md ) (` ISC002 ` )
201
202
202
- Similarly, we recommend disabling the following isort settings, which are incompatible with the
203
+ None of the above are included in Ruff's default configuration. However, if you've enabled
204
+ any of these rules or their parent categories (like ` Q ` ), we recommend disabling them via the
205
+ linter's [ ` ignore ` ] ( settings.md#ignore ) setting.
206
+
207
+ Similarly, we recommend avoiding the following isort settings, which are incompatible with the
203
208
formatter's treatment of import statements when set to non-default values:
204
209
205
210
- [ ` force-single-line ` ] ( settings.md#isort-force-single-line )
@@ -208,6 +213,12 @@ formatter's treatment of import statements when set to non-default values:
208
213
- [ ` lines-between-types ` ] ( settings.md#isort-lines-between-types )
209
214
- [ ` split-on-trailing-comma ` ] ( settings.md#isort-split-on-trailing-comma )
210
215
216
+ If you've configured any of these settings to take on non-default values, we recommend removing
217
+ them from your Ruff configuration.
218
+
219
+ When an incompatible lint rule or setting is enabled, ` ruff format ` will emit a warning. If your
220
+ ` ruff format ` is free of warnings, you're good to go!
221
+
211
222
## Exit codes
212
223
213
224
` ruff format ` exits with the following status codes:
0 commit comments