Skip to content

Commit a2e5dee

Browse files
authored
Merge pull request #1289 from DimitriPapadopoulos/blue_ruff
MNT: blue/isort/flake8 → ruff
2 parents a6b8dcc + 066431d commit a2e5dee

File tree

172 files changed

+277
-349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+277
-349
lines changed

.flake8

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

.pep8speaks.yml

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

.pre-commit-config.yaml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,14 @@ repos:
1212
- id: check-case-conflict
1313
- id: check-merge-conflict
1414
- id: check-vcs-permalinks
15-
- repo: https://github.com/grantjenks/blue
16-
rev: v0.9.1
15+
- repo: https://github.com/astral-sh/ruff-pre-commit
16+
rev: v0.3.4
1717
hooks:
18-
- id: blue
19-
- repo: https://github.com/pycqa/isort
20-
rev: 5.12.0
21-
hooks:
22-
- id: isort
23-
- repo: https://github.com/pycqa/flake8
24-
rev: 6.1.0
25-
hooks:
26-
- id: flake8
27-
exclude: "^(doc|nisext|tools)/"
18+
- id: ruff
19+
args: [--fix, --show-fix, --exit-non-zero-on-fix]
20+
exclude: = ["doc", "tools"]
21+
- id: ruff-format
22+
exclude: = ["doc", "tools"]
2823
- repo: https://github.com/pre-commit/mirrors-mypy
2924
rev: v1.5.1
3025
hooks:

doc/source/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
32
# vi: set ft=python sts=4 ts=4 sw=4 et:
43
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##

doc/tools/apigen.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,10 +405,7 @@ def discover_modules(self):
405405

406406
def write_modules_api(self, modules, outdir):
407407
# upper-level modules
408-
main_module = modules[0].split('.')[0]
409-
ulms = [
410-
'.'.join(m.split('.')[:2]) if m.count('.') >= 1 else m.split('.')[0] for m in modules
411-
]
408+
ulms = ['.'.join(m.split('.')[:2]) for m in modules]
412409

413410
from collections import OrderedDict
414411

doc/tools/build_modref_templates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def abort(error):
3838

3939
try:
4040
__import__(package)
41-
except ImportError as e:
41+
except ImportError:
4242
abort('Can not import ' + package)
4343

4444
module = sys.modules[package]

nibabel/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@
3939

4040
# module imports
4141
from . import analyze as ana
42-
from . import ecat, imagestats, mriutils
42+
from . import ecat, imagestats, mriutils, orientations, streamlines, viewers
4343
from . import nifti1 as ni1
44-
from . import orientations
4544
from . import spm2analyze as spm2
4645
from . import spm99analyze as spm99
47-
from . import streamlines, viewers
4846

4947
# isort: split
5048

nibabel/_compression.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#
88
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
99
"""Constants and types for dealing transparently with compression"""
10+
1011
from __future__ import annotations
1112

1213
import bz2

nibabel/affines.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
22
# vi: set ft=python sts=4 ts=4 sw=4 et:
33
"""Utility routines for working with points and affine transforms"""
4+
45
from functools import reduce
56

67
import numpy as np

nibabel/analyze.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
can be loaded with and without a default flip, so the saved zoom will not
8282
constrain the affine.
8383
"""
84+
8485
from __future__ import annotations
8586

8687
import numpy as np

0 commit comments

Comments
 (0)