1

I work in a project with lots of other developers and the norm is that we only lint and format our own code, not legacy.

I'm trying to find a way to run phpcs on only my code or code that I am the git blame value, is this possible? I've been looking through Advanced Usage https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-parts-of-a-file but I can't figure it out.

grmdgs
  • 585
  • 6
  • 17
  • There isn't a built-in report that is going to do exactly what you want, but the built-in Git Blame report might help to at least give you an idea of who has outstanding errors: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Reporting#printing-a-git-blame-report – Greg Sherwood Jul 19 '18 at 01:59
  • You could also copy that report class and modify it to show only error lines for a specific user instead of a summary for all users, then call PHPCS using `--report=/path/to/custom/CustomGitBlame.php` if you want to give it a go. – Greg Sherwood Jul 19 '18 at 02:00

0 Answers0