Skip to content

New cop to disallow printing from tests #2128

@kevinrobell-st

Description

@kevinrobell-st

Is your feature request related to a problem? Please describe.

We noticed some print debugging statements in test output. I assumed they were already covered by existing cops but they weren't.

Describe the solution you'd like

It'd be nice to have a cop similar to the existing Rails/Output cop that prevents print debugging in the test directory.

Describe alternatives you've considered

Writing a custom cop.

Additional context

I could technically just change the Include: field on the Rails/Output cop to prevent this from happening in tests but the error message would then be unhelpful. I also assume this would be more generally applicable outside of my own project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions