Skip to content

Commit

Permalink
Bump pre-commit dependencies (#1740)
Browse files Browse the repository at this point in the history
Also fix a mypy error in `tools.gbench.util` - the condition behaves the
same as before, but in the new mypy version, the old condition results
in an unreachable code error for the final `return False` statement.

This is most likely a bug in mypy's reachability analysis, but the fix
is easy enough here to circumvent it.
  • Loading branch information
nicholasjng authored Jan 18, 2024
1 parent 3d293cd commit 4682db0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ repos:
- id: buildifier
- id: buildifier-lint
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
rev: v1.8.0
hooks:
- id: mypy
types_or: [ python, pyi ]
args: [ "--ignore-missing-imports", "--scripts-are-modules" ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.7
rev: v0.1.13
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
Expand Down
4 changes: 1 addition & 3 deletions tools/gbench/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ def benchmark_wanted(benchmark):
if benchmark_filter is None:
return True
name = benchmark.get("run_name", None) or benchmark["name"]
if re.search(benchmark_filter, name):
return True
return False
return re.search(benchmark_filter, name) is not None

with open(fname, "r") as f:
results = json.load(f)
Expand Down

0 comments on commit 4682db0

Please sign in to comment.