Repository navigation
Pin ruff version and add explicit lint rule selection for docs - #9906
Conversation
…es (#9899) The build-sphinx job has been red on every doc PR since 2026-07-25 with no commit in this repository causing it. `astral-sh/ruff-action` was unpinned, so CI installed whatever ruff was current, and ruff 0.16 widened its *default* lint selection from 59 rules to 413. Against that wider default the documentation sources report 35 pre-existing style findings; under the old default they report none. Fix the reproducibility problem rather than the findings: - Add doc/pyopenms/ruff.toml selecting E4, E7, E9 and F explicitly. This is byte-for-byte the pre-0.16 default set (verified: ruff 0.16.2 with this file enables exactly the same 59 rules that ruff 0.15.9 enabled by default), so it is a no-op for the current tree while making the lint result independent of the installed ruff version. `ruff check doc/pyopenms` now passes on 0.13.3, 0.14.14, 0.15.9, 0.16.0 and 0.16.2 alike. - Pin the action's ruff version. The formatter has its own version-dependent style -- ruff <= 0.14 wants a blank line after a function signature removed where 0.15+ keeps it -- so `ruff format --check` needs a pinned tool even though the rule selection is now explicit. Whether to adopt more of the modern rule set stays a separate decision; none of the 35 findings is a functional bug. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SKka5hGu2GB4e5Yw1fWhsd
…ready clean The previous commit froze the selection at ruff's pre-0.16 default (59 rules) purely to make CI reproducible. That left a lot of useful linting on the table for no reason, so select every additional rule group that reports zero findings against the tree as it stands: ASYNC, C4, EXE, FA, FLY, INT, ISC, LOG, PERF, PGH, PIE, PT, PYI, RET, TRY, W and YTT. This takes the enabled set from 59 rules to 246 while remaining a no-op for every Python file -- no source change accompanies it, and `ruff check doc/pyopenms` passes unchanged on 0.13.3, 0.14.14, 0.15.9, 0.16.0 and 0.16.2. Two exceptions, both because ruff documents them as conflicting with its own formatter (https://docs.astral.sh/ruff/formatter/): - W191 and ISC002 are selected via their prefixes but explicitly ignored. - Q (flake8-quotes) is left out altogether rather than ignored, since the documented conflicts Q000-Q004 are essentially the whole group and the formatter already normalises quote style. The groups that would require touching the sources stay unselected and are listed in ruff.toml with their finding counts, so the follow-up decision from #9899 keeps its evidence next to the config. The largest of them argue against themselves: T20 flags 26 `print()` calls in scripts whose purpose is to print, and ARG flags 14 unused arguments in Sphinx extension callbacks whose signatures are fixed by Sphinx. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SKka5hGu2GB4e5Yw1fWhsd
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChangesRuff documentation validation
Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Makes pyOpenMS documentation linting reproducible across Ruff releases.
Changes:
- Adds explicit documentation lint-rule selection.
- Pins Ruff 0.16.2 in the documentation workflow.
- Documents maintenance rationale and formatter conflicts.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
doc/pyopenms/ruff.toml |
Defines stable lint rules and formatter-compatible exclusions. |
.github/workflows/doc-validate.yml |
Pins Ruff and clarifies workflow configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…e fix (#9942) Documents three merged CI-reliability PRs that were missing changelog entries: the ccache build-cache save/restore split (#9887), pinning ruff for doc-validate (#9906), and the Windows nightly test race in TOPP_OpenSwathWorkflow_17_cache (#9937). Co-authored-by: Claude <[email protected]>
Description
This PR fixes the doc-validate workflow to be resilient to ruff version changes. The issue (#9899) occurred when ruff 0.16 widened its default lint rule selection from 59 to 413 rules, causing the unpinned
astral-sh/ruff-actionto suddenly fail with no code changes.Changes:
Added
doc/pyopenms/ruff.toml: Explicitly selects the lint rules that the documentation sources were written against (ruff's pre-0.16 default: E4/E7/E9/F) plus all currently clean rule groups. This makes the lint result independent of ruff version changes.Updated
.github/workflows/doc-validate.yml:astral-sh/ruff-actionto version0.16.2to prevent unexpected formatter style changesThe configuration deliberately excludes rules that conflict with the teaching/example nature of the documentation (T20, N, ARG, RUF, UP, BLE, SIM, B, PTH, DTZ, S) and omits Q (flake8-quotes) as it conflicts with ruff's formatter.
Checklist
https://claude.ai/code/session_01SKka5hGu2GB4e5Yw1fWhsd
Summary by CodeRabbit