Skip to content

[TRIO] Add TRIO115: TrioZeroSleepCall#8486

Merged
charliermarsh merged 3 commits intoastral-sh:mainfrom
qdegraaf:feat/TRIO115
Nov 6, 2023
Merged

[TRIO] Add TRIO115: TrioZeroSleepCall#8486
charliermarsh merged 3 commits intoastral-sh:mainfrom
qdegraaf:feat/TRIO115

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

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

2 participants