fix: configure pre-commit hook to only output changed files (#7129)
Currently, the pre-commit hook will output all files that prettier analyzes.
The changed lines are highlighted in the terminal, but this highlighting is not always successful (e.g. we have seen the highlighting disappear when running inside Jenkins)
This sets prettier (when running within pre-commit) to only output changed files