From 8788d57030deef7d7ac02b6fde8f56713bdc33d5 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Tue, 16 Jan 2024 15:19:33 -0500 Subject: [PATCH] Add instructions on using `noqa` with isort rules (#9555) Closes https://github.com/astral-sh/ruff/issues/9554. --- docs/linter.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/linter.md b/docs/linter.md index 5594789dad49f..39b0d73bbd32b 100644 --- a/docs/linter.md +++ b/docs/linter.md @@ -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: