Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Baseliner does not add ignore lines for warnings when there are 0 errors #12

@peterjaap

Description

@peterjaap

Our CI fails when phpcs returns warnings, however, this package does not add warnings to the baseline, only errors.

So when I run the baseliner I get;

Running PHP_CodeSniffer (this may take a while)...
PHP_CodeSniffer did not report any errors.

But when I run phpcs;

$ vendor/bin/grumphp run --tasks phpcs -n

GrumPHP is sniffing your code!                                                                                                               
                                                                                                                                             
Running tasks with priority 0!                                                                                                               
==============================                                                                                                               
                                                                                                                                             
Running task 1/1: phpcs... ✘                                                                                                                 
                                                                                                                                             
phpcs                                                                                                                                        
=====                                                                                                                                        
              
....

And it finds a lot of warnings and exits with non-zero error code, making our pipeline fail.

I could add <config name="ignore_warnings_on_exit" value="1" /> to phpcs.xml, but then there's no record of these errors in the baseline, which is what I prefer.

Is it possible to add a flag to also create a baseline for phpcs warnings, not just errors?

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