Skip to content

Commit 93c6d92

Browse files
authored
Merge pull request #1364 from DimitriPapadopoulos/RUF
STY: Enforce ruff rules (RUF)
2 parents 7963366 + 5ea47a7 commit 93c6d92

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

nibabel/casting.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ class CastingError(Exception):
5151
getattr(np, dtype)
5252
for dtype in (
5353
'int8', 'byte', 'int16', 'short', 'int32', 'intc', 'int_', 'int64', 'longlong',
54-
'uint8', 'ubyte', 'uint16', 'ushort', 'uint32', 'uintc', 'uint', 'uint64', 'ulonglong', # noqa: E501
55-
'float16', 'half', 'float32', 'single', 'float64', 'double', 'float96', 'float128', 'longdouble', # noqa: E501
56-
'complex64', 'csingle', 'complex128', 'cdouble', 'complex192', 'complex256', 'clongdouble', # noqa: E501
54+
'uint8', 'ubyte', 'uint16', 'ushort', 'uint32', 'uintc', 'uint', 'uint64', 'ulonglong',
55+
'float16', 'half', 'float32', 'single', 'float64', 'double', 'float96', 'float128', 'longdouble',
56+
'complex64', 'csingle', 'complex128', 'cdouble', 'complex192', 'complex256', 'clongdouble',
5757
# other names of the built-in scalar types
58-
'int_', 'float_', 'complex_', 'bytes_', 'str_', 'bool_', 'datetime64', 'timedelta64', # noqa: E501
58+
'int_', 'float_', 'complex_', 'bytes_', 'str_', 'bool_', 'datetime64', 'timedelta64',
5959
# other
6060
'object_', 'void',
6161
)

nibabel/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@
108108
109109
.. _Digital Object Identifier: https://en.wikipedia.org/wiki/Digital_object_identifier
110110
.. _zenodo: https://zenodo.org
111-
""" # noqa: E501
111+
"""

nibabel/parrec.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
# copyright and license terms.
77
#
88
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
9-
# Disable line length checking for PAR fragments in module docstring
10-
# noqa: E501
119
"""Read images in PAR/REC format
1210
1311
This is yet another MRI image format generated by Philips scanners. It is an

pyproject.toml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,19 @@ select = [
131131
"PYI",
132132
"Q",
133133
"RSE",
134+
"RUF",
134135
"TCH",
135136
"UP",
136137
]
137138
ignore = [
138-
"B006", # TODO: enable
139-
"B008", # TODO: enable
139+
"B006", # TODO: enable
140+
"B008", # TODO: enable
140141
"B007",
141142
"B011",
142-
"B017", # TODO: enable
143+
"B017", # TODO: enable
143144
"B018",
144145
"B020",
145-
"B023", # TODO: enable
146+
"B023", # TODO: enable
146147
"B028",
147148
"B904",
148149
"C401",
@@ -157,6 +158,10 @@ ignore = [
157158
"PT017",
158159
"PT018",
159160
"PYI024",
161+
"RUF005",
162+
"RUF012", # TODO: enable
163+
"RUF015",
164+
"RUF017", # TODO: enable
160165
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
161166
"W191",
162167
"E111",

0 commit comments

Comments
 (0)