Closed lu-pl closed 3 weeks ago
Please replace the per file ignore with targeted inline comments:
# noqa: F401
What is the rationale for noqa over per-file-ignores?
A possible benefit of per-file-ignores is that IDE linters can still flag the unused imports, but ruff check
and pipelines will pass.
What is the rationale for noqa over per-file-ignores?
It is targeted at that specific line, instead of a broad catchall rule that might in the future ignore stuff we don't want ignored
What is the rationale for noqa over per-file-ignores?
It is targeted at that specific line, instead of a broad catchall rule that might in the future ignore stuff we don't want ignored
I see that per-line-ignores are generally a good idea (explicit is better than implicit!), but __init__.py
as the public library interface imo is an exception to that. Every import line will always have to be explicitly ignored in that case, because no symbol will be used in __init__.py
(apart from being imported).
It is of course possible that at some point actual logic will run in __init__.py
, in which case explicit per-line-ignores are strongly indicated. As soon as a symbol is actually used, F401
must not be ignored on a file level.
It is of course possible that at some point actual logic will run in
__init__.py
, in which case explicit per-line-ignores are strongly indicated. As soon as a symbol is actually used,F401
must not be ignored on a file level.
At that point, in n years, we will have totally forgotten about that one setting we have in pyproject.toml
. So lets please not postpone doing the right thing to some unspecified point in the future
Is the commit order now correct? Tests should work for
a3cdfbf
by itself, but not for24d11a6
.