Shubham Pawar Claude Sonnet 5 commited on
Commit
aa266c9
·
1 Parent(s): c8f7f2e

ci: pin ruff rule set so the lint job is deterministic

Browse files

CI installs ruff unpinned. Ruff 0.16 widened its default rule set (UP, B,
BLE, SIM, I, ...), which turned `ruff check src/` red on code written for
the older default (283 findings on main, none of them real defects).

- add ruff.toml selecting the classic default (E4/E7/E9/F) + line-length 100
- pin ruff to >=0.16,<0.17 in the lint job

`ruff check src/` and `ruff check .` now pass. Broadening the rule set
(adding I/UP/B and fixing the fallout) is left as a separate cleanup.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XbYxD9aoni29EHJ3xcUd2q

Files changed (2) hide show
  1. .github/workflows/ci.yml +2 -2
  2. ruff.toml +16 -0
.github/workflows/ci.yml CHANGED
@@ -32,9 +32,9 @@ jobs:
32
  - name: Install dependencies
33
  run: |
34
  python -m pip install --upgrade pip
35
- pip install ruff mypy
36
  pip install -r requirements.txt
37
-
38
  - name: Run Ruff linter
39
  run: ruff check src/ --output-format=github
40
 
 
32
  - name: Install dependencies
33
  run: |
34
  python -m pip install --upgrade pip
35
+ pip install "ruff>=0.16,<0.17" mypy
36
  pip install -r requirements.txt
37
+
38
  - name: Run Ruff linter
39
  run: ruff check src/ --output-format=github
40
 
ruff.toml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ruff configuration.
2
+ #
3
+ # CI installs ruff unpinned and runs `ruff check src/`. Ruff 0.16 broadened its
4
+ # default rule set (adding UP, B, BLE, SIM, I, ...), which silently turned the
5
+ # lint job red on a codebase written against the older default. This file pins
6
+ # the intended rule set so lint is deterministic across ruff versions.
7
+ #
8
+ # The selection below is Ruff's classic default (pycodestyle errors + pyflakes).
9
+ # Widen it deliberately (e.g. add "I", "UP", "B") in a dedicated cleanup pass,
10
+ # not as a side effect of an unrelated ruff upgrade.
11
+
12
+ line-length = 100
13
+ target-version = "py313"
14
+
15
+ [lint]
16
+ select = ["E4", "E7", "E9", "F"]