-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[pylint
] Implement invalid-bool-return-type
(E304
)
#10377
[pylint
] Implement invalid-bool-return-type
(E304
)
#10377
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! And welcome to the project :)
crates/ruff_linter/resources/test/fixtures/pylint/invalid_return_type_bool.py
Show resolved
Hide resolved
crates/ruff_linter/resources/test/fixtures/pylint/invalid_return_type_bool.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! If you're interested, I'd love to have a PR which updates the documentation and tests in a similar manner for the invalid-str-return-type
rule.
invalid-bool-returned
in pylintpylint
] Implement invalid-bool-return-type
(E304
)
I will work on it! Thank you :) |
…#10400) ## Summary Added some docs, and a little of test cases in `invalid-str-return-type`, mentioned in #10377 (review) ## Test Plan On `invalid_return_type_str.py`. --------- Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
Summary
Implement
E304
in the issue #970.Link is here: https://pylint.readthedocs.io/en/stable/user_guide/messages/error/invalid-bool-returned.html
Throws an error when the returning value of
__bool__
method is not booleanTest Plan
I've written it in the
invalid_return_type_bool.py
.Hi! Actually, this is my first pull request in my life, so please tell me if there is something wrong with the code.
(I used the code written in #4854, and slightly modified it.)
Thanks :)