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

Treat unchanged files as normal #11

Closed sirbrillig closed 5 years ago

sirbrillig commented 5 years ago

Previously unchanged files caused a NonFatalException which allowed the linter to skip them and move on to the next file. This was done under the assumption that running the linter on such files was done by mistake, since by definition they have no changed lines.

However, this behavior denies the Reporter the opportunity to make that decision itself.

It can also be confusing when run on only unchanged files because in those cases even with the JSON reporter, no output is produced and no error code is set.

With this diff, unchanged files will be treated simply has having no phpcs messages, and the Reporter can decide how best to deal with that.