ci: trim pre-commit to ruff + snakefmt, run ruff in CI, quote ledger shas - #817
Merged
Merged
Conversation
…shas pre-commit.ci has failed on every PR since #805 because the hook set could never converge: add-trailing-comma and ruff-format rewrote each other's output, blackdoc crashed on a YAML snippet inside a docstring, pyupgrade was pinned to py39 against a py311 target, and pretty-format-yaml rewrote the unquoted sha `51e1719` in tests/equivalence/hotfixes.yaml as the YAML float `.inf` (PR #816, HF-7 and HF-20), which is what broke test_waiver_ledger there. - .pre-commit-config.yaml: keep pre-commit-hooks basics, ruff-check, ruff-format and snakefmt; drop the four hooks above and the notebook cleaner; `ci.autofix_prs: false` so the bot reports instead of pushing commits into contributors' branches. - main.yml: fast-tests now runs `ruff check` and `ruff format --check` with the same ruff pin as the hook (0.15.0), so lint is enforced without the external service. - hotfixes.yaml: every `commit:`/`ported_sha:` value quoted (40 rows), so no YAML loader can read a sha as a number. - Fix the three ruff findings on develop (RUF001, RUF059, RUF046) and drop the removed PD901 rule from extend-ignore. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rts green Mechanical output of `ruff check --fix` (9 findings: RUF046 int(len()), RUF100 stale noqa) and `ruff format` (14 files), plus two hand fixes in tests/equivalence/diagnostics/p_max_pu_quantiles.py: the E702 semicolon line split in two and a noqa for the typographic minus sign in a figure label. end-of-file-fixer adds the missing newline to .gitignore. Verified on Sherlock (job 45731301): ruff check and format --check clean, pre-commit run --all-files clean, 424 fast tests pass. Co-Authored-By: Claude Fable 5.1 <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.
Why
pre-commit.ci has failed on every PR since #805, and on #816 its autofix commit broke
fast-tests. The hook set could never converge:add-trailing-commaandruff-formatrewrote each other's output on every run.blackdoccrashed on a YAML snippet inside a docstring (resources:is not Python).pyupgradewas pinned--py39-plusagainsttarget-version = "py311", and ruff'sUPrules already cover it.pretty-format-yamlrewrote the unquoted sha51e1719intests/equivalence/hotfixes.yamlas the YAML float.inf(HF-7 and HF-20), which is exactly whattest_waiver_ledger.pycaught on Validate sector weather year #816.developitself was not ruff-0.15-clean (11 findings, 14 files unformatted), so the bot pushed a 22-file rewrite into every contributor's branch.What
.pre-commit-config.yamlkept topre-commit-hooksbasics,ruff-check,ruff-formatandsnakefmt. The four hooks above and the notebook cleaner are removed, with the reason recorded in the file.ci.autofix_prs: false, so pre-commit.ci reports and never pushes commits into PR branches.main.yml: thefast-testsjob now runsruff checkandruff format --checkwith the same pin as the hook (0.15.0). Lint is enforced by GitHub Actions itself, so the external service is optional and can be uninstalled without losing coverage.hotfixes.yaml: all 40commit:/ported_sha:values quoted so no YAML loader can read a sha as a number.ruff check --fix,ruff format, plus two hand fixes (an E702 semicolon line split, anoqafor the typographic minus in a figure label) and the removedPD901rule dropped fromextend-ignore.Verified
On Sherlock (job 45731301):
ruff checkandruff format --checkclean,pre-commit run --all-filesclean, 424 fast tests pass (10 skipped for the missingmaster-benchmarkworktree, as in a fresh clone).Fixes the
fast-testsfailure on #816 once that branch is rebased on or merged with this.🤖 Generated with Claude Code