Skip to content

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

@Pierre-Sassoulas

Description

@Pierre-Sassoulas

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.

Metadata

Metadata

Labels

Enhancement ✨Improvement to a componentMaintenanceDiscussion or action around maintaining pylint or the dev workflowNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions