Skip to content

Commit 7781929

Browse files
Switch linter from flake8 to ruff
Ruff is 10-100x faster, supports auto-fix, and replaces flake8 plus plugins in a single tool. Translated .flake8 config to ruff.toml, auto-fixed all existing lint errors, and made CI lint step blocking.
1 parent 95c1e75 commit 7781929

File tree

4 files changed

+22
-55
lines changed

4 files changed

+22
-55
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ jobs:
3535
- name: Install dependencies
3636
run: pixi run install-all
3737

38-
- name: Flake8 (non-blocking)
39-
continue-on-error: true
40-
run: pixi run flake8 src/ tests/
38+
- name: Ruff lint
39+
run: pixi run lint
4140

4241
- name: Pytest
4342
run: pixi run test

pixi.lock

Lines changed: 6 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ morphologist = ">=0.0.29"
1414
disco = ">=6.0"
1515
pip = ">=25.3,<26"
1616
setuptools = ">=65.0,<81"
17-
flake8 = ">=7.3.0,<8"
1817
pytest = ">=7.0"
1918
pytest-cov = ">=4.0"
2019
pytest-mock = ">=3.10"
@@ -24,6 +23,7 @@ dracopy = ">=1.4.2"
2423
huggingface-hub = ">=0.20.0"
2524
transformers = ">=4.36.0"
2625
datasets = ">=2.16.0"
26+
ruff = ">=0.9.0"
2727

2828
[tasks]
2929
# Initialize submodules
@@ -92,6 +92,11 @@ uninstall-all = """
9292
echo "Uninstallation of Pixi-managed dependencies complete."
9393
"""
9494

95+
# Linting tasks
96+
lint = "ruff check src/ tests/"
97+
lint-fix = "ruff check --fix src/ tests/"
98+
format = "ruff format src/ tests/"
99+
95100
# Testing tasks
96101
test = "pytest tests/ -v"
97102
test-unit = "pytest tests/ -v -m unit"

ruff.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
line-length = 120
2+
exclude = [".pixi", "__pycache__", "external", "*.pyc"]
3+
4+
[lint]
5+
extend-ignore = ["E203"]
6+
7+
[lint.per-file-ignores]
8+
"__init__.py" = ["F401"]

0 commit comments

Comments
 (0)