Skip to content

RFE: prohibit use of grep in boolean context #5

@scop

Description

@scop

Similarly as the nice ProhibitGrepToGetFirstFoundElement, it would be nice to have a check that looks for use of grep to check if an element exists, i.e. in boolean context.

When found, it would advise to use List::Util::any() (or ::none() when inverted) instead, mainly for performance but arguably for semantic reasons, too.

Perhaps call it ProhibitGrepToCheckIfElementExists or ProhibitGrepInBooleanContext.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions