Summary
CI's lint job only runs ruff check hashview/ hashview.py (.github/workflows/lint.yml), and the pre-push hook mirrors that scope. Everything else in the repo is unlinted: running ruff check . (ruff 0.9.7, same version as CI) on v0.8.3-dev reports 212 violations, of which 105 are auto-fixable with --fix.
Breakdown
By location:
| Path |
Violations |
tests/ |
188 |
install/hashview-agent/ |
17 |
migrations/env.py |
4 |
setup.py |
3 |
Top rules:
| Rule |
Count |
Notes |
| E702 multiple-statements-on-one-line |
77 |
mostly the user = _admin(); _login(client, user) test idiom — could instead be allowed via per-file-ignores for tests/ |
| I001 unsorted-imports |
60 |
auto-fixable |
| F401 unused-import |
38 |
auto-fixable |
| UP015 redundant-open-modes |
9 |
auto-fixable |
| F841 unused-variable |
9 |
auto-fixable |
| E402 import-not-at-top |
5 |
some are intentional (agent config side effects, conftest stubs) — needs # noqa or per-file-ignores |
| E741 ambiguous-variable-name |
3 |
manual (l in comprehensions) |
| E722 bare-except |
1 |
manual, in hashview-agent.py |
| misc UP/B/F541 |
10 |
mostly auto-fixable |
Proposed approach
Single mechanical cleanup PR:
- Run
ruff check . --fix for the ~105 autofixes.
- Hand-fix the small remainder (E741, E722, B007, B017, F841 leftovers).
- Decide policy on E702 in tests: either fix all 77 or add
per-file-ignores = { "tests/**" = ["E702"] } in pyproject.toml if the semicolon seed/login idiom is preferred.
- Add
# noqa: E402 where the late import is deliberate (agent's post-config imports, migrations/env.py, tests/agent_unit/conftest.py).
- Widen CI to
ruff check . in lint.yml and update the pre-push hook to match.
Keeping it in its own PR keeps the diff mechanical and out of the way of the in-flight feature branches (#431/#436 both touch many of the same test files).
🤖 Generated with Claude Code
Summary
CI's lint job only runs
ruff check hashview/ hashview.py(.github/workflows/lint.yml), and the pre-push hook mirrors that scope. Everything else in the repo is unlinted: runningruff check .(ruff 0.9.7, same version as CI) onv0.8.3-devreports 212 violations, of which 105 are auto-fixable with--fix.Breakdown
By location:
tests/install/hashview-agent/migrations/env.pysetup.pyTop rules:
user = _admin(); _login(client, user)test idiom — could instead be allowed viaper-file-ignoresfortests/# noqaor per-file-ignoreslin comprehensions)hashview-agent.pyProposed approach
Single mechanical cleanup PR:
ruff check . --fixfor the ~105 autofixes.per-file-ignores = { "tests/**" = ["E702"] }inpyproject.tomlif the semicolon seed/login idiom is preferred.# noqa: E402where the late import is deliberate (agent's post-config imports,migrations/env.py,tests/agent_unit/conftest.py).ruff check .inlint.ymland update the pre-push hook to match.Keeping it in its own PR keeps the diff mechanical and out of the way of the in-flight feature branches (#431/#436 both touch many of the same test files).
🤖 Generated with Claude Code