Skip to content

Commit 599984e

Browse files
chore: update pre-commit hooks (#1240)
* chore: update pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.4.10 → v0.5.0](astral-sh/ruff-pre-commit@v0.4.10...v0.5.0) * style: pre-commit fixes * turn off the new checks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: jpivarski <[email protected]> Co-authored-by: Jim Pivarski <[email protected]>
1 parent aaf2396 commit 599984e

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repos:
2323
- id: black
2424

2525
- repo: https://github.com/astral-sh/ruff-pre-commit
26-
rev: v0.4.10
26+
rev: v0.5.0
2727
hooks:
2828
- id: ruff
2929
args: [--fix, --show-fixes]

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ ignore = [
134134
"SIM114", # combine `if` branches using logical `or` operator
135135
"S307", # no eval allowed
136136
"PLC1901", # empty string is falsey (but I don't want to rely on such weak typing)
137-
"RUF012" # enforces type annotations on a codebase that lacks type annotations
137+
"RUF012", # enforces type annotations on a codebase that lacks type annotations
138+
"SIM103" # interferes with my if-elif-elif-else blocks
138139
]
139140
select = [
140141
"E",

src/uproot/interpretation/library.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def __repr__(self):
165165
return repr(self.name)
166166

167167
def __eq__(self, other):
168-
return type(_libraries[self.name]) is type(_libraries[other.name]) # noqa: E721
168+
return type(_libraries[self.name]) is type(_libraries[other.name])
169169

170170

171171
class NumPy(Library):
@@ -751,14 +751,14 @@ def concatenate(self, all_arrays):
751751
def _is_pandas_rangeindex(pandas, index):
752752
if hasattr(pandas, "RangeIndex") and isinstance(index, pandas.RangeIndex):
753753
return True
754-
if hasattr(index, "is_integer") and index.is_integer():
754+
elif hasattr(index, "is_integer") and index.is_integer():
755755
return True
756-
if uproot._util.parse_version(pandas.__version__) < uproot._util.parse_version(
756+
elif uproot._util.parse_version(pandas.__version__) < uproot._util.parse_version(
757757
"1.4.0"
758758
) and isinstance(index, pandas.Int64Index):
759759
return True
760-
761-
return False
760+
else:
761+
return False
762762

763763

764764
def _strided_to_pandas(path, interpretation, data, arrays, columns):

src/uproot/interpretation/objects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def basket_array_forth(
201201
options,
202202
):
203203
awkward = uproot.extras.awkward()
204-
import awkward.forth
204+
import awkward.forth # noqa: F811
205205

206206
self.hook_before_basket_array(
207207
data=data,

0 commit comments

Comments
 (0)