Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bump pre-commit dependencies #1740

Merged
merged 1 commit into from
Jan 18, 2024
Merged

Bump pre-commit dependencies #1740

merged 1 commit into from
Jan 18, 2024

Conversation

nicholasjng
Copy link
Contributor

Bumps mypy to v1.8.0, and ruff to v0.1.13.

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.

@@ -131,7 +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):
if re.search(benchmark_filter, name) is not None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about just

return re.search(benchmark_filter, name) is not None

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call! Done in 6eece2b.

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.
@dmah42 dmah42 merged commit 4682db0 into google:main Jan 18, 2024
78 of 80 checks passed
@nicholasjng nicholasjng deleted the dev-updates branch April 15, 2024 16:46
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants