Skip to content

Commit

Permalink
MNT: flake8/black/isort → ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos committed Dec 14, 2023
1 parent b248ae6 commit 0db5166
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 35 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install black/isort
run: python -m pip install black isort[colors]
- name: Install ruff
run: python -m pip install ruff[colors]
- name: Check fMRIPrep
run: |
python -m black --diff --color --check fmriprep
python -m isort --diff --color --check fmriprep
python -m ruff check --diff --color --check fmriprep
python -m ruff format --diff --color --check fmriprep
- name: Check wrapper
run: |
python -m black --diff --color --check wrapper
python -m isort --diff --color --check wrapper
python -m ruff check --diff --color --check wrapper
python -m ruff format --diff --color --check wrapper
codespell:
name: Check for spelling errors
Expand Down
11 changes: 4 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 23.1.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.7
hooks:
- id: black
- id: ruff
files: ^fmriprep/|^wrapper/
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- id: ruff-format
files: ^fmriprep/|^wrapper/
27 changes: 10 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ doc = [
"sphinx_rtd_theme>=0.5.2",
]
dev = [
"black ~= 22.3.0",
"pre-commit",
"isort ~= 5.10.1",
"ruff >= 0.1.8",
"flake8-pyproject",
]
duecredit = ["duecredit"]
Expand Down Expand Up @@ -121,23 +120,17 @@ version-file = "fmriprep/_version.py"
# Developer tool configurations
#

[tool.black]
[tool.ruff]
line-length = 99
target-version = ['py39']
skip-string-normalization = true

[tool.isort]
profile = 'black'

[tool.flake8]
max-line-length = "99"
doctests = "False"
exclude = "*build/"
ignore = ["W503", "E203"]
per-file-ignores = [
"**/__init__.py : F401",
"docs/conf.py : E265",
]
extend-select = ["I"]
exclude = ["*build/"]
extend-ignore = ["E203"]
quote-style = "preserve"

[tool.ruff.lint.per-file-ignores]
"**/__init__.py" = ["E402"]
""docs/conf.py" = ["E265"]

[tool.pytest.ini_options]
norecursedirs = [".git"]
Expand Down
7 changes: 2 additions & 5 deletions wrapper/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ universal = true
# Developer tool configurations
#

[tool.black]
[tool.ruff]
line-length = 99
target-version = ['py39']
skip-string-normalization = true

[tool.isort]
profile = 'black'
#skip-string-normalization = true

0 comments on commit 0db5166

Please sign in to comment.