Skip to content

Commit 016a4b7

Browse files
feat: Introducing Ruff config, removing .flake8, updating pre-commit-config
1 parent 35e5790 commit 016a4b7

File tree

4 files changed

+39
-30
lines changed

4 files changed

+39
-30
lines changed

.flake8

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ documentation:
33
- any-glob-to-any-file: ['doc/source/**/*']
44
maintenance:
55
- changed-files:
6-
- any-glob-to-any-file: ['.github/**/*', '.flake8', 'pyproject.toml', 'docker/**/*']
6+
- any-glob-to-any-file: ['.github/**/*', 'ruff.toml', 'pyproject.toml', 'docker/**/*']
77
dependencies:
88
- changed-files:
99
- any-glob-to-any-file: ['requirements/*']

.pre-commit-config.yaml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,17 @@
11
repos:
22

33

4-
- repo: https://github.com/psf/black
5-
rev: 25.1.0 # IF VERSION CHANGES --> MODIFY "blacken-docs" MANUALLY AS WELL!!
4+
- repo: https://github.com/astral-sh/ruff-pre-commit
5+
rev: v0.11.8
66
hooks:
7-
- id: black
8-
args: [
9-
"doc/source/conf.py",
10-
"examples"
11-
]
7+
- id: ruff
128

139
- repo: https://github.com/adamchainz/blacken-docs
1410
rev: 1.19.1
1511
hooks:
1612
- id: blacken-docs
1713
additional_dependencies: [black==24.8.0]
1814

19-
- repo: https://github.com/pycqa/isort
20-
rev: 6.0.1
21-
hooks:
22-
- id: isort
23-
args: [
24-
"--profile", "black",
25-
"--force-sort-within-sections",
26-
"--line-length", "100",
27-
]
28-
29-
- repo: https://github.com/PyCQA/flake8
30-
rev: 7.2.0
31-
hooks:
32-
- id: flake8
33-
3415
- repo: https://github.com/codespell-project/codespell
3516
rev: v2.4.1
3617
hooks:

ruff.toml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
exclude = [
2+
"build",
3+
"doc/source/conf.py",
4+
]
5+
6+
line-length = 100
7+
8+
[format]
9+
quote-style = "double"
10+
indent-style = "space"
11+
docstring-code-format = true
12+
13+
[lint]
14+
select = [
15+
"E", # pycodestyle, see https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
16+
"I", # isort, see https://docs.astral.sh/ruff/rules/#isort-i
17+
]
18+
ignore = [
19+
"D", # pydocstyle, see https://docs.astral.sh/ruff/rules/#pydocstyle-d
20+
"F", # pyflakes, see https://docs.astral.sh/ruff/rules/#pyflakes-f
21+
"N", # pep8-naming, see https://docs.astral.sh/ruff/rules/#pep8-naming-n
22+
"PTH", # flake8-use-pathlib, https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
23+
"TD", # flake8-todos, https://docs.astral.sh/ruff/rules/#flake8-todos-td
24+
"W", # pycodestyle, see https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
25+
]
26+
27+
[lint.pydocstyle]
28+
convention = "numpy"
29+
30+
[lint.isort]
31+
combine-as-imports = true
32+
force-sort-within-sections = true
33+
34+
[lint.mccabe]
35+
max-complexity = 10

0 commit comments

Comments
 (0)