[pylint] Implement invalid-bool-return-type (E304)#10377
Merged
dhruvmanila merged 4 commits intoastral-sh:mainfrom Mar 13, 2024
hikaru-kajita:invalid-bool-return
Merged
[pylint] Implement invalid-bool-return-type (E304)#10377dhruvmanila merged 4 commits intoastral-sh:mainfrom hikaru-kajita:invalid-bool-return
pylint] Implement invalid-bool-return-type (E304)#10377dhruvmanila merged 4 commits intoastral-sh:mainfrom
hikaru-kajita:invalid-bool-return
Conversation
Contributor
|
dhruvmanila
requested changes
Mar 13, 2024
Member
dhruvmanila
left a comment
There was a problem hiding this comment.
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
dhruvmanila
approved these changes
Mar 13, 2024
Member
dhruvmanila
left a comment
There was a problem hiding this comment.
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)
Contributor
Author
I will work on it! Thank you :) |
dhruvmanila
added a commit
that referenced
this pull request
Mar 14, 2024
…#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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement
E304in 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 :)