Skip to content

ci: trim pre-commit to ruff + snakefmt, run ruff in CI, quote ledger shas - #817

Merged
ktehranchi merged 2 commits into
developfrom
fix/precommit-config
Sep 28, 2026
Merged

ktehranchi merged 2 commits into
developfrom
fix/precommit-config

Conversation

@ktehranchi

Copy link
Copy Markdown
Collaborator

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-comma and ruff-format rewrote each other's output on every run.
  • blackdoc crashed on a YAML snippet inside a docstring (resources: is not Python).
  • pyupgrade was pinned --py39-plus against target-version = "py311", and ruff's UP rules already cover it.
  • pretty-format-yaml rewrote the unquoted sha 51e1719 in tests/equivalence/hotfixes.yaml as the YAML float .inf (HF-7 and HF-20), which is exactly what test_waiver_ledger.py caught on Validate sector weather year #816.
  • develop itself 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

  1. .pre-commit-config.yaml kept to pre-commit-hooks basics, ruff-check, ruff-format and snakefmt. 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.
  2. main.yml: the fast-tests job now runs ruff check and ruff format --check with 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.
  3. hotfixes.yaml: all 40 commit: / ported_sha: values quoted so no YAML loader can read a sha as a number.
  4. One-time cleanup (second commit, mechanical): ruff check --fix, ruff format, plus two hand fixes (an E702 semicolon line split, a noqa for the typographic minus in a figure label) and the removed PD901 rule dropped from extend-ignore.

Verified

On Sherlock (job 45731301): ruff check and ruff format --check clean, pre-commit run --all-files clean, 424 fast tests pass (10 skipped for the missing master-benchmark worktree, as in a fresh clone).

Fixes the fast-tests failure on #816 once that branch is rebased on or merged with this.

🤖 Generated with Claude Code

ktehranchi and others added 2 commits September 28, 2026 10:51
…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>
@ktehranchi
ktehranchi merged commit c17378d into develop Sep 28, 2026
9 checks passed
ktehranchi added a commit that referenced this pull request Sep 30, 2026
Brings the branch level with develop before the PR: the 2026-09-22 harness
merge, #813, #816 and #817 (quoted ledger shas). No conflicts; the diff
against develop is only tests/equivalence/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant