From 9228e140ade059fd06ef98f1797bcaf6025732ac Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 17:04:15 -0400 Subject: [PATCH] Run ruff check in Lint, with F811 and F821 on for the package 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 --- .github/workflows/code_changes.yaml | 10 ++++++++++ .github/workflows/pr_code_changes.yaml | 10 ++++++++++ changelog.d/ruff-check-lint.changed.md | 1 + 3 files changed, 21 insertions(+) create mode 100644 changelog.d/ruff-check-lint.changed.md diff --git a/.github/workflows/code_changes.yaml b/.github/workflows/code_changes.yaml index 5ba890a038..7be2311241 100644 --- a/.github/workflows/code_changes.yaml +++ b/.github/workflows/code_changes.yaml @@ -31,6 +31,16 @@ jobs: uses: astral-sh/setup-uv@v8.1.0 - name: Check formatting run: uvx ruff format --check . + - name: Lint + # The ruff rules pyproject.toml selects, then two pyflakes rules it + # ignores, checked in the package: F811, a definition that a later + # one of the same name silently replaces (two PRs that each add a + # Simulation.set_input merge cleanly, and the second wins; uk hub + # notice 16), and F821, an undefined name. Neither has a finding + # in the package today. + run: | + uvx ruff check . + uvx ruff check --select F811,F821 policyengine_uk Test: # Linux arm64 keeps the CPU architecture of the macOS runners this job # used to run on. GitHub-hosted macOS runners are scarce, so PR runs diff --git a/.github/workflows/pr_code_changes.yaml b/.github/workflows/pr_code_changes.yaml index 055741c182..762d15b79e 100644 --- a/.github/workflows/pr_code_changes.yaml +++ b/.github/workflows/pr_code_changes.yaml @@ -51,6 +51,16 @@ jobs: uses: astral-sh/setup-uv@v8.1.0 - name: Check formatting run: uvx ruff format --check . + - name: Lint + # The ruff rules pyproject.toml selects, then two pyflakes rules it + # ignores, checked in the package: F811, a definition that a later + # one of the same name silently replaces (two PRs that each add a + # Simulation.set_input merge cleanly, and the second wins; uk hub + # notice 16), and F821, an undefined name. Neither has a finding + # in the package today. + run: | + uvx ruff check . + uvx ruff check --select F811,F821 policyengine_uk Test: # Linux arm64 keeps the CPU architecture of the macOS runners this job # used to run on. GitHub-hosted macOS runners are scarce, so PR runs diff --git a/changelog.d/ruff-check-lint.changed.md b/changelog.d/ruff-check-lint.changed.md new file mode 100644 index 0000000000..46cced5c96 --- /dev/null +++ b/changelog.d/ruff-check-lint.changed.md @@ -0,0 +1 @@ +- Run `ruff check` in the Lint job, with the pyflakes rules for a definition silently replaced by a later one (F811) and an undefined name (F821) on for the package, so two merged PRs that each define the same method fail Lint.