Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Avoid raising TRIO115 violations for trio.sleep(...) calls with non-number values #8532

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

qdegraaf
Copy link
Contributor

@qdegraaf qdegraaf commented Nov 6, 2023

Summary

Fixes bug in TRIO115 where it would not return for values that were not a NumberLiteral so

x = "bla"
trio.sleep(x)

would set off a false positive

Test Plan

Added test case to fixture

@zanieb zanieb changed the title [TRIO115] Return if assigned value of arg is not an Expr::NumberLiteral in TRIO115 Avoid raising TRIO115 violations for trio.sleep(...) calls with non-number values Nov 6, 2023
@zanieb zanieb added the bug Something isn't working label Nov 6, 2023
Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Contributor

github-actions bot commented Nov 6, 2023

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@zanieb zanieb merged commit 9a8400a into astral-sh:main Nov 6, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants