Skip to content

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

Merged
zanieb merged 2 commits intoastral-sh:mainfrom
qdegraaf:fix/fixTRIO115
Nov 6, 2023
Merged

Avoid raising TRIO115 violations for trio.sleep(...) calls with non-number values#8532
zanieb merged 2 commits intoastral-sh:mainfrom
qdegraaf:fix/fixTRIO115

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!

@github-actions
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
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.

2 participants