Home > Mobile >  Running pre-commit on all files in git beyond HEAD
Running pre-commit on all files in git beyond HEAD

Time:03-15

I have already made git commits, 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

  • Related