Skip to content

Commit c067e2b

Browse files
committed
ci: Add Ruff linting
1 parent 3169bb5 commit c067e2b

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
concurrency:
44
group: ${{ github.workflow }}-${{ github.ref }}
@@ -15,10 +15,8 @@ on:
1515
- main
1616

1717
jobs:
18-
flake8:
19-
18+
codelint:
2019
runs-on: ubuntu-latest
21-
2220
steps:
2321
- uses: actions/checkout@v5
2422
- name: Set up Python 3.10
@@ -28,8 +26,12 @@ jobs:
2826
- name: Install dependencies
2927
run: |
3028
python -m pip install --upgrade pip
31-
pip install flake8-pyproject
29+
pip install flake8-pyproject ruff
3230
33-
- name: Lint with flake8
31+
- name: Lint codebase with flake8
3432
run: |
3533
flake8 --builtins=ArgumentError .
34+
35+
- name: Lint codebase with ruff
36+
run: |
37+
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)