mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 21:05:08 +00:00
[ruff
] Implement invalid-assert-message-literal-argument
(RUF040
) (#14488)
## Summary This PR implements new rule discussed [here](https://github.com/astral-sh/ruff/discussions/14449). In short, it searches for assert messages which were unintentionally used as a expression to be matched against. ## Test Plan `cargo test` and review of `ruff-ecosystem`
This commit is contained in:
parent
557d583e32
commit
9e4ee98109
8 changed files with 85 additions and 0 deletions
|
@ -978,6 +978,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
|
|||
(Ruff, "038") => (RuleGroup::Preview, rules::ruff::rules::RedundantBoolLiteral),
|
||||
(Ruff, "048") => (RuleGroup::Preview, rules::ruff::rules::MapIntVersionParsing),
|
||||
(Ruff, "039") => (RuleGroup::Preview, rules::ruff::rules::UnrawRePattern),
|
||||
(Ruff, "040") => (RuleGroup::Preview, rules::ruff::rules::InvalidAssertMessageLiteralArgument),
|
||||
(Ruff, "100") => (RuleGroup::Stable, rules::ruff::rules::UnusedNOQA),
|
||||
(Ruff, "101") => (RuleGroup::Stable, rules::ruff::rules::RedirectedNOQA),
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue