Add instructions on using noqa with isort rules (#9555)

Closes https://github.com/astral-sh/ruff/issues/9554.
This commit is contained in:
Charlie Marsh 2024-01-16 15:19:33 -05:00 committed by GitHub
parent f426c0fdaf
commit 8788d57030
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -304,6 +304,14 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
""" # noqa: E501
```
For import sorting, the `noqa` should come at the end of the first line in the import block, and
will apply to all imports in the block, like so:
```python
import os # noqa: I100
import abc
```
To ignore all violations across an entire file, add the line `# ruff: noqa` anywhere in the file,
preferably towards the top, like so: