Skip to content

4.0.x-dev: Option to ignore if no files were checked instead of exiting with an error code #3556

@AndreasA

Description

@AndreasA

Describe the bug
In our project we sometimes prepare pipelines to be used for future files.
However, as those files might not yet exist, phpcs could stop with No files were checked error. The solution is to disable phpcs temporarily but then once the files are there, it might be forgotten to enable them again.

I think instead of always failing, there should be an option to skip this error.

To reproduce
Steps to reproduce the behavior:

  1. Run phpcs against an empty directory.

It fails which in most cases is fine but there should be an option to not fail instead.

Expected behavior

Option to ignore if no files were checked.

Versions (please complete the following information):

  • OS: MacOS 12.2.1
  • PHP: 8.1
  • PHPCS: 4.0.x-dev
  • Standard: PSR2

For now I add a temporary php file that does nothing instead.

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