fix: pin ruff <0.16, and actually run it in CI - #9
Merged
Conversation
`ruff` was declared in the dev extra but no workflow ever invoked it, so it enforced nothing. Two problems fixed together: 1. Pin `ruff>=0.5,<0.16`. ruff 0.16 moved a large set of opinionated rules into its DEFAULT set; unpinned it reported 76 findings here, 73 of them annotation-style suggestions (UP045/UP037/UP006) the rest of the suite doesn't enforce. Same cap as the four workflow adapters. 2. Add a `lint` job running `ruff check .`, so the pin guards a check that runs. Single Python version — lint results don't vary across the matrix. The 3 real findings under the pin were all in examples/ and are fixed: - marimo_example.py computed `state_color` then never used it, so the status table rendered the state uncolored; now applied as intended. - script_example.py had an f-string with no placeholders. - jupyter_example.ipynb E402 is inherent to notebooks (each cell is its own top level) → excluded per-file, not worked around in the example. Verified: ruff resolves to 0.15.22, `ruff check .` passes, 19 tests pass, both edited examples parse, and the notebook is still linted for everything except E402. No change to the shipped `spore` package.
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.
ruffwas declared in the dev extra but no workflow ever invoked it, so itenforced nothing. Found while auditing the Python repos after ruff 0.16 broke
miniwdl-spawnand had leftcwl-spawn'smainred for six days(spore-host/cwl-spawn#5).
Pinning alone would have been the tidy-looking fix and would have left the real
gap in place, so this does both.
1. Pin
ruff>=0.5,<0.16ruff 0.16 moved a large set of opinionated rules into its default rule set.
Unpinned here:
The 73-finding delta is almost entirely annotation-style suggestions — 36
UP045,13
UP037, 7UP006— that no other repo in the suite enforces. Same cap asairflow-spawn,cwl-spawn,miniwdl-spawnandsnakemake-executor-plugin-spawn.2. Add a
lintjobruff check .on 3.12 only — lint results don't vary across the test matrix, sofanning it out over 3.9–3.12 would just be four times the work for the same answer.
3. Fix the 3 real findings
All in
examples/, none in the shippedsporepackage:marimo_example.pybuilt astate_colormap from the instance state and thennever used it (
F841) — so the status table rendered**{inst.state}**uncolored. The dead variable was the tell that the colorization was written but
never wired up; now applied, which is what the example meant to demonstrate.
script_example.py— f-string with no placeholders (F541).jupyter_example.ipynb—E402(import not at top of cell) is inherent tonotebooks, where each cell is its own top level. Excluded per-file rather than
contorting the example. Verified the notebook is still linted for everything
else;
E402is the only ignore.Verification
ruff --version→ 0.15.22;ruff check .→ All checks passedpytest tests/→ 19 passedast.parse)E402Related: spore-host#518 (the CI outage that started this audit).