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

Uniformize compare-to-zero, compare-to-empty-string with the use-implicit-booleaness-x checks #6871

Closed
Pierre-Sassoulas opened this issue Jun 6, 2022 · 1 comment · Fixed by #6870 or #9093
Assignees
Labels
Enhancement ✨ Improvement to a component Maintenance Discussion or action around maintaining pylint or the dev workflow Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Milestone

Comments

@Pierre-Sassoulas
Copy link
Member

Pierre-Sassoulas commented Jun 6, 2022

Current problem

compare-to-zero and compare-to-empty-string are the same check basically than use-implicit-booleaness-not-copmparison.

Doing x != 0 feel safer and easier to understand than bool(x) for int (you need a background in C to understand that). Socompare-to-zero feel more opinionated which is probably why they are in their own optional checker.

compare-to-empty-string though is really an use-implicit-booleaness-not-copmparison check.

Desired solution

I think it would make sense to merge compare-to-empty-string . Renaming them so they all follow the same pattern could be an option.

Additional context

#6861

I've done the work in #6870 then realized that compare-to-zero was opinionated.

@DanielNoord
Copy link
Collaborator

I think the compare-to-zero should stay an extension. Implicit booleanness of string does make sense to merge.

@DanielNoord DanielNoord added Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed Needs decision 🔒 Needs a decision before implemention or rejection labels Jul 2, 2022
@Pierre-Sassoulas Pierre-Sassoulas self-assigned this Sep 28, 2022
@Pierre-Sassoulas Pierre-Sassoulas added Enhancement ✨ Improvement to a component Maintenance Discussion or action around maintaining pylint or the dev workflow and removed Discussion 🤔 labels Nov 6, 2022
@Pierre-Sassoulas Pierre-Sassoulas added this to the 3.0.0b1 milestone May 2, 2023
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 3.0.0b1, 3.0.0a7 May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component Maintenance Discussion or action around maintaining pylint or the dev workflow Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
2 participants