Skip to content

Commit de13162

Browse files
committed
ci: Add Ruff linting
1 parent 3e6c852 commit de13162

2 files changed

Lines changed: 20 additions & 6 deletions

File tree

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Flake8
1+
name: Lint
22

33
permissions:
44
contents: read
@@ -18,10 +18,8 @@ on:
1818
- main
1919

2020
jobs:
21-
flake8:
22-
21+
codelint:
2322
runs-on: ubuntu-latest
24-
2523
steps:
2624
- uses: actions/checkout@v6
2725
- name: Set up Python 3.10
@@ -31,8 +29,12 @@ jobs:
3129
- name: Install dependencies
3230
run: |
3331
python -m pip install --upgrade pip
34-
pip install flake8-pyproject
32+
pip install flake8-pyproject ruff
3533
36-
- name: Lint with flake8
34+
- name: Lint codebase with flake8
3735
run: |
3836
flake8 --builtins=ArgumentError .
37+
38+
- name: Lint codebase with ruff
39+
run: |
40+
ruff check --preview --output-format github

pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ exclude = ["binder", "docker", "docs", "tests", "examples"]
6969
[tool.setuptools_scm]
7070
fallback_version = "0+untagged"
7171

72+
[tool.ruff]
73+
line-length = 90
74+
75+
[tool.ruff.lint]
76+
# Add the following rule sets
77+
extend-select = ["E", "W", "F", "B", "UP", "SIM", "I"]
78+
# But ignore these inconvenient rules
79+
ignore = ["F403", "E226", "E731", "E275", "F405", "E722", "E741", "W605"]
80+
81+
[tool.ruff.lint.isort]
82+
known-first-party = ["devito", "examples"]
83+
7284
[tool.flake8]
7385
max-line-length = 90
7486
ignore = [

0 commit comments

Comments
 (0)