Skip to content

Add TRIO110 rule - #8537

Merged
charliermarsh merged 5 commits into
astral-sh:mainfrom
karpetrosyan:add-trio-110-suppor
Nov 7, 2023
Merged

charliermarsh merged 5 commits into
astral-sh:mainfrom
karpetrosyan:add-trio-110-suppor

Conversation

@karpetrosyan

@karpetrosyan karpetrosyan commented Nov 7, 2023 •

Copy link
Copy Markdown
Contributor

Summary

Adds TRIO110 from the flake8-trio plugin.
Relates to: #8451

Comment thread crates/ruff_linter/src/checkers/ast/analyze/statement.rs Outdated
@github-actions

github-actions Bot commented Nov 7, 2023 •

Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Comment thread crates/ruff_linter/src/rules/flake8_trio/rules/unneeded_sleep.rs Outdated

@charliermarsh charliermarsh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice, thank you!

}
}

pub(crate) fn unneeded_sleep(checker: &mut Checker, while_stmt: &ast::StmtWhile) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In general, we prefer passing in the typed node (ast::StmtWhile instead of the individual properties of it, like body). That way, users can't accidentally pass an AST node of the wrong type.

@charliermarsh
charliermarsh force-pushed the add-trio-110-suppor branch 4 times, most recently from fa98de6 to cdd9910 Compare November 7, 2023 21:19
@charliermarsh
charliermarsh enabled auto-merge (squash) November 7, 2023 21:21
@charliermarsh
charliermarsh merged commit 0126f74 into astral-sh:main Nov 7, 2023
@charliermarsh charliermarsh added rule Implementing or modifying a lint rule preview Related to preview-mode features labels Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Related to preview-mode features rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants