diff --git a/.github/workflows/pr_code_changes.yaml b/.github/workflows/pr_code_changes.yaml index 592dbe51..1db90fa2 100644 --- a/.github/workflows/pr_code_changes.yaml +++ b/.github/workflows/pr_code_changes.yaml @@ -16,7 +16,7 @@ jobs: uses: astral-sh/setup-uv@v8.1.0 - name: Install relevant dependencies run: | - uv pip install "ruff>=0.9.0" --system + uv pip install "ruff>=0.16.0,<0.17.0" --system - name: Check code formatting run: make check-format diff --git a/changelog.d/lint-on-main.fixed.md b/changelog.d/lint-on-main.fixed.md new file mode 100644 index 00000000..19045498 --- /dev/null +++ b/changelog.d/lint-on-main.fixed.md @@ -0,0 +1 @@ +The Lint job no longer fails on an untouched checkout: documentation prose is excluded from the formatter, and the ruff version is bounded so a future release cannot silently change what the job checks. diff --git a/pyproject.toml b/pyproject.toml index f1134e01..3e220a1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ dependencies = [ dev = [ "pytest>=8.0.0,<10.0.0", "pytest-cov>=6.0.0,<8.0.0", - "ruff>=0.9.0", + "ruff>=0.16.0,<0.17.0", "mypy>=1.2.3,<2.0.0", "build>=1.2.0,<2.0.0", "towncrier>=24.8.0", @@ -101,3 +101,9 @@ showcontent = true directory = "removed" name = "Removed" showcontent = true + +[tool.ruff] +# Documentation is prose, not a lint surface. ruff 0.16.0 began formatting +# Python inside markdown code blocks, which reformatted five docs files that +# nobody had edited and turned the Lint job red on an untouched checkout. +extend-exclude = ["docs/**/*.md"]