sirbrillig / phpcs-changed

🐘 Run phpcs on files and only report new warnings/errors compared to the previous version.
MIT License
31 stars 11 forks source link

Add the ignore option and tests #32

Closed david-binda closed 4 years ago

david-binda commented 4 years ago

PHPCS has an ignore option which allows developers to skip certain directories or files, specified via patterns.

In order to be able to use phpcs-changed as a drop-in replacement for phpcs, phpcs-changed should have the --ignore options which works similarly to the one in phpcs.

This PR introduces a shouldIgnorePath function, which follows the same logic the phpcs does when it's filtering the files (the function body is mostly a copy-paste of the original).

Part of the #26 .

sirbrillig commented 4 years ago

Thank you!