Use PHP_CodeSniffer for modified lines only
In 2017, since CodeSniffer 3.0.0 release, there is new --cache
option.
Or you can use EasyCodingStandard, that does this by default.
Conceptually it does not make sense.
phpcs needs to know the hole context in order to analyze correctly.
Scanning only the changed lines would remove context.
There is a project lint-diffs
that can run any linter on diff output files.
Use phpcs --report=emacs
as the command. The regex can be the same as the example config.