Skip to content

Style/RedundantCondition is doing unsafe corrections #13913

@byroot

Description

@byroot

After #13729 the Style/RedundantCondition is doing corrections that I don't believe are safe.

One example from the Rails codebase:

     def save(**) # :nodoc:
-      Suppressor.registry[self.class.name] ? true : super
+      Suppressor.registry[self.class.name] || super
     end

This change the code from returning true to return anything that is "thruthy", which in some case could be a problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions