Skip to content

Commit 8788d57

Browse files
Add instructions on using noqa with isort rules (#9555)
Closes #9554.
1 parent f426c0f commit 8788d57

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/linter.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,14 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
304304
""" # noqa: E501
305305
```
306306

307+
For import sorting, the `noqa` should come at the end of the first line in the import block, and
308+
will apply to all imports in the block, like so:
309+
310+
```python
311+
import os # noqa: I100
312+
import abc
313+
```
314+
307315
To ignore all violations across an entire file, add the line `# ruff: noqa` anywhere in the file,
308316
preferably towards the top, like so:
309317

0 commit comments

Comments
 (0)