build: point lint tasks at pre-commit - #1369
Open
davidberenstein1957 wants to merge 2 commits into
Open
Conversation
`task lint` and `task format` ran `ruff` and `mypy .`, neither of which this repo enforces: there is no ruff config anywhere, ruff is absent from .pre-commit-config.yaml, and CI (.github/workflows/pre-commit.yml) runs pre-commit only. The result was that both tasks reported ~1300 findings and rewrote ~120 otherwise-clean files, and one ruff SIM117 autofix produced syntactically invalid code in tests/test_powermetrics.py. Both tasks now run pre-commit, matching CI exactly. On current master they pass clean. Also drops the unreferenced `ruff` dev dependency, fixes the `precommit` task (its command was the stray string "c"), and removes `docs-check-drift`, which pointed at scripts/check-docs-drift.py — a file that does not exist. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1369 +/- ##
==========================================
+ Coverage 91.39% 91.43% +0.03%
==========================================
Files 49 49
Lines 5056 5056
==========================================
+ Hits 4621 4623 +2
+ Misses 435 433 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the
task lint/task formattasks so they run what CI actually enforces.What changed
Also drops the now-unreferenced
ruffdev dependency, and removes thedocs-check-drifttask, which pointed atscripts/check-docs-drift.py— a file that does not exist.Why
There is no ruff config anywhere in the repo, ruff is not in
.pre-commit-config.yaml, and.github/workflows/pre-commit.ymlis the only lint job in CI. Soruff check .was running against its own defaults, unrelated to the style the codebase is written in and never gating anything.mypy .likewise walkedcarbonserver/andwebapp/rather than the-m codecarbonscope the existingmypy-checktask uses.The practical effect was that anyone following
CLAUDE.md's instruction to run these before submitting got ~1300 findings and ~120 rewritten files on an otherwise clean tree — and ruff'sSIM117autofix rewrote a nestedwithintests/test_powermetrics.pyinto syntactically invalid Python.Verification
Passes clean on
origin/master, matchinguv run pre-commit run --all-files.Notes for review
linttask is gone, not aliased. pre-commit checks and fixes in one pass, so alinttask pointing at it would rewrite the working tree — the opposite of what someone typinglintexpects. There is one task,format, anddocs/how-to/agent-instructions.md(a.k.a.CLAUDE.md) now points at it.mypy .walkedcarbonserver/andwebapp/instead of the package, it is not in.pre-commit-config.yamland not in CI, so it gated nothing while producing noise.mypy-check, scoped to-m codecarbon, is untouched and still available for anyone who wants a type check.rufffrom the dev group is deliberate: leaving an unconfigured, unenforced linter installed is what caused this. If the project wants ruff, it should land as a configured pre-commit hook with the codebase brought into line in its own PR.Closes #1368
🤖 Generated with Claude Code