PHP_CodeSniffer icon indicating copy to clipboard operation
PHP_CodeSniffer copied to clipboard

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

Open AndreasA opened this issue 2 years ago • 0 comments

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.

AndreasA avatar Mar 09 '22 09:03 AndreasA