Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pylint] Implement invalid-bool-return-type (E304) #10377

Merged
merged 4 commits into from Mar 13, 2024

Conversation

boolean-light
Copy link
Contributor

@boolean-light boolean-light commented Mar 13, 2024

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 boolean

Test 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 :)

Copy link

github-actions bot commented Mar 13, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

Copy link
Member

@dhruvmanila dhruvmanila left a 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 :)

@dhruvmanila dhruvmanila added the rule Implementing or modifying a lint rule label Mar 13, 2024
Copy link
Member

@dhruvmanila dhruvmanila left a 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.

@dhruvmanila dhruvmanila changed the title implement E304 invalid-bool-returned in pylint [pylint] Implement invalid-bool-return-type (E304) Mar 13, 2024
@dhruvmanila dhruvmanila merged commit c269c1a into astral-sh:main Mar 13, 2024
17 checks passed
@boolean-light
Copy link
Contributor Author

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.

I will work on it! Thank you :)

@boolean-light boolean-light deleted the invalid-bool-return branch March 14, 2024 00:55
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants