Repository navigation
ci: lint tools, tests and examples with a hash-pinned ruff - #126
Merged
Merged
Conversation
About 2,000 lines of Python had no linter, so unused names and similar bug classes were caught only in review. A separate Lint job installs ruff 0.16.10 by hash (.github/lint-requirements.txt) and runs it with ruff.toml: syntax and statement errors, pyflakes and bugbear, no style rules. The first run's 20 findings are fixed in this commit: 12 semicolon-joined test statements are split, an unused test variable is removed, a deliberate import after a sys.path entry is marked, and six zip() calls state strict=True where the lengths are equal by construction. CONTRIBUTING explains that linting is CI-only; the tools still import nothing outside the standard library. The job is not added to the required checks yet. Closes #55 Co-Authored-By: Claude Opus 5.5 <[email protected]>
drevendev
force-pushed
the
beautifulrepo/ruff-ci-20261023
branch
from
October 23, 2026 09:13
6981f9a to
ecfd2ce
Compare
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.
Reader problem and change
About 2,000 lines of Python in
tools/,tests/andexamples/had no linter, so unused names and likely bugs were caught only in review.Lintjob installs ruff 0.16.10 withpip install --require-hashes --no-deps -r .github/lint-requirements.txt. It runsruff check --output-format github.ruff.tomlselects a small rule set:E4,E7,E9,F(pyflakes) andB(bugbear). There are no style or formatting rules.tests/test_catalog.pyare split, at the exact columns ruff reported;tests/test_curated_starter.pyis removed;sys.pathentry inexamples/repository-audit/demo.pyis marked# noqa: E402;zip()calls now passstrict=True, three in the tools and three in the tests. In each case the lengths are equal by construction, so a future mismatch fails loudly instead of being truncated silently.tests/test_lint_setup.pychecks the exact pin and hash, the hash-checked install, and that no tool or example imports ruff.Closes #55
Evidence
ruff 0.16.10 was published to PyPI on 2026-10-01. Locally, in a scratch virtualenv:
All checks passed!. The behaviour of the three toolzip()calls is unchanged, and all 304 tests pass.Verification
Lintjob on a runner.Limitations
ubuntu-latestuses. Other platforms install the same version without the hash check.Lintto the master ruleset once it has stayed green for a while, as Run linters and type checkers in CI #55 suggests; this PR does not change the ruleset. Dependabot does not watch the pin yet.🤖 Generated with Claude Code