Skip to content

Commit

Permalink
Add instructions on using noqa with isort rules (#9555)
Browse files Browse the repository at this point in the history
Closes #9554.
  • Loading branch information
charliermarsh authored Jan 16, 2024
1 parent f426c0f commit 8788d57
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/linter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit 8788d57

Please # to comment.