Skip to content

Identical/duplicate rules: compare-with-tuple (SIM109) and repeated-equality-comparison (PLR1714) #22328

@GideonBear

Description

@GideonBear

Summary

The rules compare-with-tuple (SIM109) and repeated-equality-comparison (PLR1714) do (mostly) the same, resulting in duplicate lints: playground

Note that on SIM109 seems to only work on variables. When using literals: playground

I propose removing one of the rules, similarly to repeated-isinstance-calls (PLR1701).

Alternatively, the relation between these two rules should be explained in the documentation, and the PLR1714 should be suppressed when SIM109 is also found, to avoid duplicate lints.

Version

ruff 0.14.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingBreaking API changeruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions