no_self_comparisons

SeverityQuick FixOptions
Warning

Details

DO avoid self comparisons.

Bad
if (foo == foo) {}
if (foo.property == foo.property) {}
Good
if (foo == bar) {}
if (foo.property == bar.property) {}

Usage

To enable the no_self_comparisons rule, add no_self_comparisons under plugins > pyramid_lint > diagnostics in your analysis_options.yaml file:

plugins:
  pyramid_lint: <version>
    diagnostics:
      no_self_comparisons: true