mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 21:05:08 +00:00
[pylint
] Implement invalid-bool-return-type
(E304
) (#10377)
## Summary Implement `E304` in the issue #970. Throws an error when the returning value of `__bool__` method is not boolean. Reference: https://pylint.readthedocs.io/en/stable/user_guide/messages/error/invalid-bool-returned.html ## Test Plan Add test cases and run `cargo test`
This commit is contained in:
parent
32d6f84e3d
commit
c269c1a706
8 changed files with 143 additions and 0 deletions
|
@ -240,6 +240,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
|
|||
(Pylint, "E0237") => (RuleGroup::Stable, rules::pylint::rules::NonSlotAssignment),
|
||||
(Pylint, "E0241") => (RuleGroup::Stable, rules::pylint::rules::DuplicateBases),
|
||||
(Pylint, "E0302") => (RuleGroup::Stable, rules::pylint::rules::UnexpectedSpecialMethodSignature),
|
||||
(Pylint, "E0304") => (RuleGroup::Preview, rules::pylint::rules::InvalidBoolReturnType),
|
||||
(Pylint, "E0307") => (RuleGroup::Stable, rules::pylint::rules::InvalidStrReturnType),
|
||||
(Pylint, "E0604") => (RuleGroup::Stable, rules::pylint::rules::InvalidAllObject),
|
||||
(Pylint, "E0605") => (RuleGroup::Stable, rules::pylint::rules::InvalidAllFormat),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue