Skip to content

Add maxWarnings config option to allow zero-code exit if number of violations is below a threshold#3389

Open
sergey-solo wants to merge 1 commit intosquizlabs:masterfrom
sergey-solo:add_max_warnings_option
Open

Add maxWarnings config option to allow zero-code exit if number of violations is below a threshold#3389
sergey-solo wants to merge 1 commit intosquizlabs:masterfrom
sergey-solo:add_max_warnings_option

Conversation

@sergey-solo
Copy link

@sergey-solo sergey-solo commented Jul 15, 2021

I see there's open PR that adds baseline check. This PR addresses same problem: introducing PHPCS to legacy projects where the number of issues is too great to address them immediately.

--max-warnings option will not silence the issues, the emphasis is on exit-code only.

Basically, if there's 50 errors or warnings, providing --max-warnings=50 will allow to still exit with 0.

There's a caveat, though: if you a make changes to a file with pre-existing violations, you might want to compensate --max-warnings value by the number of old violations that were fixed(if any) in order to not swallow newly created violations(if any) anywhere in the codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant