Repository navigation
fix(scripts): make .github/scripts ruff-clean; pin ruff in Workflow Scripts - #370
Merged
Merged
Conversation
The Workflow Scripts job runs `ruff check` and `ruff format --check` over
.github/scripts and had 411 findings, so it failed on every run that
reached it (manual dispatches, and now the forced weekly schedule).
- ruff.toml: give .github/scripts the same per-file ignores as scripts/**
(T20, S602/S603/S607) plus RUF001 (status emoji) and PLR2004 (argv and
semver-part counts), with the rationale inline.
- ruff format and the safe/unsafe autofixes (import order, unused unpacked
variables, merged comparisons, implicit Optional, needless assigns).
- Hand fixes: module/function docstrings, loop-variable shadowing, raise
... from, a scheme check before urlopen, a logged warning instead of a
bare except/pass, inline json imports hoisted, `os.popen('date')`
replaced by datetime, and two unused parameters removed with their call
sites. get_env_bool now honors its `default` argument, which it ignored.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MtQ5LP2n3t3bs7AhptkKJ
An unpinned `pip install ruff` lets each new ruff release add findings and fail the job with no change in the repo. Pin to 0.16.10, the version the scripts were cleaned against. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017MtQ5LP2n3t3bs7AhptkKJ
| script_path.write_text(script_content) | ||
| os.chmod(script_path, 0o755) | ||
| # Generated scripts are executables invoked by workflows. | ||
| os.chmod(script_path, 0o755) # noqa: S103 |
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.
Workflow Scriptsranruff checkandruff format --checkon.github/scriptsand hit 411 findings, so it failed on every manual dispatch. With #369 merged it now also fails the forced weekly schedule (dispatch run 37272339104).ruff.toml:.github/scripts/**gets the same per-file ignores asscripts/**(T20, S602/S603/S607), plus RUF001 (status emoji) and PLR2004 (argv and semver-part counts). The rationale is written inline.ruff format, plus safe and unsafe autofixes reviewed in the diff.urlopen, a logged warning instead ofexcept: pass, hoisted imports,os.popen('date')replaced bydatetime, and unused parameters removed together with their call sites.get_env_bool(key, default)ignoreddefault.reusable-ci.ymlnow installsruff==0.16.10.Local checks:
ruff check,ruff format --checkandcompileallare clean.pytest testspasses 67/67, the same as before the change.🤖 Generated with Claude Code
https://claude.ai/code/session_017MtQ5LP2n3t3bs7AhptkKJ