Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Ruff lint

# Ruff runs on every PR and every push to master.
#
# Two steps:
# * Strict: runs the rule subset for which the codebase is clean today.
# Failures block the workflow, so regressions of these rules cannot be
# merged.
# * Backlog (non-blocking): runs the full configured ruleset (E, F, I) and
# surfaces the existing backlog of cleanups (import sorting, unused imports,
# long lines, etc.). It is marked `continue-on-error: true`; as the backlog
# is cleared the rules can be migrated into the strict step.

on:
pull_request:
branches: [master]
types: [synchronize, opened, reopened, ready_for_review]
push:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ruff-strict:
name: Ruff (strict — real-bug rules)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run ruff (strict subset)
uses: astral-sh/ruff-action@v3
with:
args: "check --select F821,F403,F405 ."

ruff-backlog:
name: Ruff (full ruleset — non-blocking)
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run ruff (full configured ruleset)
uses: astral-sh/ruff-action@v3
with:
args: "check ."
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,14 @@ neo = ["resources/*.json"]

[tool.black]
line-length = 120

[tool.ruff]
line-length = 120
target-version = "py310"
extend-exclude = ["doc/old_stuffs", "doc/build", "dist", "tmp.py"]

[tool.ruff.lint]
select = ["E", "F", "I"]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403"]
Loading