chore(lint): Enable Pyflakes rules across all packages#497
chore(lint): Enable Pyflakes rules across all packages#497ayushiahjolia wants to merge 1 commit into
Conversation
976823e to
8a0fcc9
Compare
| [tool.ruff.lint] | ||
| preview = true | ||
| select = ["TID252"] # Enforce absolute imports (ban relative imports) | ||
| select = ["F", "TID252"] # Pyflakes (unused imports, undefined names, etc.) + absolute imports |
There was a problem hiding this comment.
Unused imports in Python might be actually used because the imported symbols may not be used in the current module, instead be used by other modules importing this module
There was a problem hiding this comment.
Hmm I relied on tests to verfify this, I found one variable which was used at runtime, but no other issues.
|
d238353 "update ruff config" added: +select = ["TID252"] # Enforce absolute imports (ban relative imports) This is the regression point. Adding TID252 as the sole entry overrode the default and silently switched off F (and the E4/E7/E9 subset). From here, unused imports/vars accumulated undetected. The PR could optionally also restore E4/E7/E9 (the rest of the old default) via select = ["E4","E7","E9","F","TID252"], since those were dropped in the same commit. And a minor pre-existing inconsistency: the testing package sets preview = false while the others set preview = true. Not necessarily in scope for this PR :-) |
8a0fcc9 to
7247180
Compare
7247180 to
d29e7c4
Compare
Issue #, if available: #479
Description of changes:
Enables the Pyflakes (
F) rule category in ruff across all packages. reviously onlyTID252(ban relative imports) was enforced, meaning unused imports, undefined names, and unused variables went undetected.Testing -
ci-checks.shpasses (tests, coverage, typecheck, fmt for all packages)ruff check --select F,TID252reports zero violationsBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.