PHP_CodeSniffer
PHP_CodeSniffer copied to clipboard
`GitModified` and `GitStaged` filters blindly expect that the `git` command is available
Is your feature request related to a problem?
When the GitModified or GitStaged filters are used, the code blindly expects that the git command-line tool is available. This results in unexpected behaviour if this assumption is not true.
Describe the solution you'd like
It would be better for end users if a suitable error message (and exit code) is presented describing the problem.
Additional context (optional)
This suggestion was initially raised in https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/1105#pullrequestreview-2868073742
- [x] I have read the Contribution Guidelines and this is not a support question.
- [ ] I intend to create a pull request to implement this feature.
I wonder whether it would even make sense to do this validation as early as in the Config class ?
Oh and another one for which the same applies: the GitBlame report class ;-)