I have already made git commit
s, but want to re-run pre-commit
on files above a current Git HEAD commit. I intend to do this in CI with a second, more feature-full pre-commit
configuration called .pre-commit-other-config.yaml
.
I can accomplish this like so:
git show --name-only --format="" HEAD | pre-commit run --config .pre-commit-other-config.yaml
I am wondering: is there a built-in option for this in pre-commit
?
Asides
I am not interested in all files (pre-commit run -a
).
CodePudding user response:
surprised you didn't check the docs for pre-commit run
you're looking for --from-ref
and --to-ref
disclaimer: I wrote pre-commit