Skip to content

Conversation

harupy
Copy link
Contributor

@harupy harupy commented Jun 5, 2022

Type of Changes

Type
βœ“ πŸ“œ Docs

Description

Refs #5953

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not remember we had this check. This is very, very similar to use-implicit-booleaness-not-x type check, it kinda make me want to rename this or move them all in their own checker to make it coherent. Do you have an opinion on this @harupy ?

@harupy
Copy link
Contributor Author

harupy commented Jun 6, 2022

@Pierre-Sassoulas

move them all in their own checker to make it coherent.

Sounds good to me :)

@Pierre-Sassoulas
Copy link
Member

Ok, I took a closer look. compare-to-zero and compare-to-empty-stringare quite more opinionated than use-implicit-booleaness-not-len and use-implicit-booleaness-not-copmparison which is probably why they are in their own optional checker.

Doing x != 0 or feel a lot safer and easier to understand than bool(x) for int (you need a background in C to understand that). Renaming them could be an option, I'm going to open an issue to discuss it but in the meantime I think we could merge this.

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #6871 if you want to chime in :)

@Pierre-Sassoulas Pierre-Sassoulas merged commit 34c6aed into pylint-dev:main Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants