Skip to content

Commit 6e55bf6

Browse files
committed
MNT: Copy ruff/precommit config from smriprep
STY: Exclude .svg files from whitespace cleanups, check JSON and TOML
1 parent f3e95d9 commit 6e55bf6

File tree

2 files changed

+48
-15
lines changed

2 files changed

+48
-15
lines changed

.pre-commit-config.yaml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
exclude: ".*/data/.*"
22
repos:
3-
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
44
rev: v4.4.0
55
hooks:
6-
- id: trailing-whitespace
7-
- id: end-of-file-fixer
8-
- id: check-yaml
9-
- id: check-added-large-files
10-
- repo: https://github.com/psf/black
11-
rev: 23.1.0
6+
- id: trailing-whitespace
7+
exclude: '.*\.svg'
8+
- id: end-of-file-fixer
9+
exclude: '.*\.svg'
10+
- id: check-yaml
11+
- id: check-json
12+
- id: check-toml
13+
- id: check-added-large-files
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
rev: v0.1.6
1216
hooks:
13-
- id: black
14-
files: ^fmriprep/|^wrapper/
15-
- repo: https://github.com/pycqa/isort
16-
rev: 5.12.0
17-
hooks:
18-
- id: isort
19-
files: ^fmriprep/|^wrapper/
17+
- id: ruff
18+
- id: ruff-format

pyproject.toml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ version-file = "fmriprep/_version.py"
123123

124124
[tool.black]
125125
line-length = 99
126-
target-version = ['py39']
127126
skip-string-normalization = true
128127

129128
[tool.isort]
@@ -146,3 +145,38 @@ doctest_optionflags = "ALLOW_UNICODE NORMALIZE_WHITESPACE ELLIPSIS"
146145
env = "PYTHONHASHSEED=0"
147146
filterwarnings = ["ignore::DeprecationWarning"]
148147
junit_family = "xunit2"
148+
149+
[tool.ruff]
150+
line-length = 99
151+
extend-select = [
152+
"F",
153+
"E",
154+
"W",
155+
"I",
156+
"UP",
157+
"YTT",
158+
"S",
159+
"BLE",
160+
"B",
161+
"A",
162+
# "CPY",
163+
"C4",
164+
"DTZ",
165+
"T10",
166+
# "EM",
167+
"EXE",
168+
"FA",
169+
"ISC",
170+
"ICN",
171+
"PT",
172+
"Q",
173+
]
174+
175+
[tool.ruff.flake8-quotes]
176+
inline-quotes = "single"
177+
178+
[tool.ruff.extend-per-file-ignores]
179+
"*/test_*.py" = ["S101"]
180+
181+
[tool.ruff.format]
182+
quote-style = "single"

0 commit comments

Comments
 (0)