Skip to content

Run ruff check in Lint, with F811 and F821 on for the package - #2355

Open
MaxGhenis wants to merge 2 commits into
mainfrom
ruff-check-lint
Open

MaxGhenis wants to merge 2 commits into
mainfrom
ruff-check-lint

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Part of workstream W2 of the Autumn Budget CI plan, raised by the UK hub (notice 16).

Why

The Lint job runs only ruff format --check, so no lint rule runs in CI. Two open PRs, #2076 and #2354, each define Simulation.set_input. Git merges them cleanly and the second definition silently replaces the first. That's pyflakes F811 (redefinition of an unused name), and nothing catches it.

Change

In the Lint job of pr_code_changes.yaml (pull requests) and code_changes.yaml (main):

uvx ruff check .
uvx ruff check --select F811,F821 policyengine_uk
  • First command: the rules pyproject.toml already selects, with its ignores. It passes on main today, so this adds no new failures.
  • Second command: F811 (redefinition) and F821 (undefined name), which pyproject.toml ignores, on the package only. Neither has a finding there on main under ruff 0.15.7 (the uv.lock pin), 0.16.7 or 0.17.0 (what unpinned uvx resolves on CI now). The one F811 on main is in a docs notebook (docs/book/programs/gov/hmrc/income-tax.ipynb), which this leaves alone.
  • The job name stays Lint. No branch rule requires any check today, so nothing changes there. It matters once Publish only the policyengine-uk release files whose checks passed #2306's merge queue and required checks arrive.

Checked

Interaction: #2306 (W2 release integrity) rewrites these workflow files and already carries this identical step in all three of them. If this lands first, #2306's rebase conflicts in each Lint hunk; take #2306's side. If #2306 lands first, close this PR.

Known limits

From the review:

axiom: n/a: CI tooling

🤖 Generated with Claude Code

Lint ran only ruff format --check, so no lint rule ever ran in CI. Two open
PRs (#2076 and #2354) each define Simulation.set_input; git merges them
cleanly and the second definition silently replaces the first (UK hub
notice 16). Run the rules pyproject.toml selects, then F811 (redefinition)
and F821 (undefined name), which pyproject.toml ignores, on policyengine_uk.
Neither has a finding there today; the one F811 on main is in a docs
notebook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Oct 11, 2026
The same Lint step as #2355, in the pull request, main and release
workflows this PR rewrites, so whichever of the two lands second keeps it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Oct 11, 2026
ruff formats and checks notebooks under docs/ and scripts/ as well as
the package, so a documentation-only pull request can land a violation
that then fails Lint for every later pull request: #1696 landed a
notebook that failed the format check, and #1743 fixed it. Lint takes
seconds, so run it on every pull request instead of only when the
Changes job finds code. Found by the independent review of #2355.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Collaborator Author

Hand-off to the UK hub from W2 of the Autumn Budget CI plan (session local_6c1ab389), per your notice 16.

MaxGhenis added a commit that referenced this pull request Oct 11, 2026
…ot run

#2355 adds ruff check --select F811,F821 to Lint, so 'CI checks
formatting only' would go stale once it lands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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