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

[TRIO] Add TRIO115: TrioZeroSleepCall #8486

Merged
merged 3 commits into from
Nov 6, 2023

Conversation

qdegraaf
Copy link
Contributor

@qdegraaf qdegraaf commented Nov 4, 2023

Summary

Adds TRIO115 from the flake8-trio plugin.

Test Plan

Added a new fixture, based on the one from upstream plugin

Issue link

Relates to: #8451

}
}
Expr::Name(ast::ExprName { id, .. }) => {
let scope = checker.semantic().current_scope();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't find a more compact way to do this yet. In case there is one somewhere in the repo already, happy to hear about it and refactor this.

/// Checks for calls of `trio.sleep(0)` and suggests replacement with `trio.lowlevel.checkpoint()`
///
/// ## Why is this bad?
/// Although equivalent to `trio.sleep(0)`, a call to `trio.lowlevel.checkpoint()` is more
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interpreted from upstream plugin, couldn't find additional info in docs or PRs on the reason. All input is welcome

Copy link
Contributor

github-actions bot commented Nov 4, 2023

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@charliermarsh charliermarsh self-requested a review November 6, 2023 01:09
@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Nov 6, 2023
@charliermarsh charliermarsh enabled auto-merge (squash) November 6, 2023 01:12
@charliermarsh charliermarsh merged commit f3e2d12 into astral-sh:main Nov 6, 2023
16 checks passed
@qdegraaf qdegraaf deleted the feat/TRIO115 branch November 6, 2023 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants