Skip to content

Commit

Permalink
chore: update pre-commit hooks (#1119)
Browse files Browse the repository at this point in the history
* chore: update pre-commit hooks

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.14 → v0.2.1](astral-sh/ruff-pre-commit@v0.1.14...v0.2.1)

* adjusting to pre-commits new constraints

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jim Pivarski <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and jpivarski authored Feb 14, 2024
1 parent c03bbf7 commit 71cca34
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
- id: black

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
rev: v0.2.1
hooks:
- id: ruff
args: [--fix, --show-fixes]
Expand Down
18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ requires = [
"hatch-vcs"
]

[lint.mccabe]
max-complexity = 100

[project]
authors = [
{name = "Jim Pivarski", email = "[email protected]"}
Expand Down Expand Up @@ -114,6 +117,9 @@ exclude = [
"src/uproot/__init__.py",
"docs-sphinx/*.py"
]
src = ["src"]

[tool.ruff.lint]
ignore = [
"E501",
"E722",
Expand All @@ -122,7 +128,7 @@ ignore = [
"SIM118", # key in dict, broken since uproot doesn't behave like a dict
"PGH003", # too-broad type ignore
"SIM114", # combine `if` branches using logical `or` operator
"PGH001", # no eval allowed
"S307", # no eval allowed
"PLC1901", # empty string is falsey (but I don't want to rely on such weak typing)
"RUF012" # enforces type annotations on a codebase that lacks type annotations
]
Expand All @@ -146,16 +152,10 @@ select = [
"UP", # pyupgrade
"YTT" # flake8-2020
]
src = ["src"]

[tool.ruff.lint]
isort.required-imports = ["from __future__ import annotations"]

[tool.ruff.mccabe]
max-complexity = 100

[tool.ruff.per-file-ignores]
"dev/*" = ["T20"]
[tool.ruff.lint.per-file-ignores]
"dev/*" = ["T20", "T201"]
"src/uproot/*/file.py" = ["SIM115"]

[tool.setuptools_scm]
Expand Down
5 changes: 3 additions & 2 deletions src/uproot/behaviors/TBranch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2788,7 +2788,8 @@ def _regularize_expression(
)

else:
to_compute = aliases[expression] if expression in aliases else expression
# the value of `expression` is either what we want to compute or a lookup value for it
to_compute = aliases.get(expression, expression)

is_jagged = False
expression_branches = []
Expand Down Expand Up @@ -3028,7 +3029,7 @@ def _ranges_or_baskets_to_arrays(
else:
notifications.put(range_or_basket)

original_index += 1
original_index += 1 # noqa: SIM113 (don't use `enumerate` for `original_index`)

branchid_to_branch[branch.cache_key] = branch

Expand Down

0 comments on commit 71cca34

Please sign in to comment.