Skip to content

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.

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
@nicholasjng nicholasjng deleted the dev-updates branch April 15, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants