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.