Question
The docu show how to complete ignore I001 for the whole file by adding a line-level comment the first import:
# Current state: Completely ignore I001 for the whole file (even if its a "line-level" comment)
import os # noqa: I001
import abc
It is weird to me, that the line-level command does not only exclude the current line from the check, disable it for the whole file. But I guess that for historical reasons(?)
However, it would be very helpful if we could sort import until a certain line...
import os
import sys
# Question/Proposal: Sort all above, ignore all below
import abc
...or, more flexible for a block:
# Question/Proposal: Support block-level ignore (currently not working)
import os
import sys
# ruff: disable[I001]
import abc
# ruff: enable[I001]
Is this possible somehow?
Motivation: Sometimes, a module needs to be strictly imported first or last to ensure it will overwrite or gets overwritten/patched. Yet, the rest of the import should be sorted and formatted as usual
Version
ruff 0.15.2
Question
The docu show how to complete ignore I001 for the whole file by adding a line-level comment the first import:
It is weird to me, that the line-level command does not only exclude the current line from the check, disable it for the whole file. But I guess that for historical reasons(?)
However, it would be very helpful if we could sort import until a certain line...
...or, more flexible for a block:
Is this possible somehow?
Motivation: Sometimes, a module needs to be strictly imported first or last to ensure it will overwrite or gets overwritten/patched. Yet, the rest of the import should be sorted and formatted as usual
Version
ruff 0.15.2