pre-commit sets some environment variables when you run it with --from-ref foo --to-ref bar that could hopefully be easily picked up and used same as --commits foo..bar. This would make it quite easy to validate every commit in a pre-commit based CI workflow.
For example, when running pre-commit run --from-ref=main --to-ref=HEAD the following env vars are set:
pre-commit
sets some environment variables when you run it with--from-ref foo --to-ref bar
that could hopefully be easily picked up and used same as--commits foo..bar
. This would make it quite easy to validate every commit in a pre-commit based CI workflow.For example, when running
pre-commit run --from-ref=main --to-ref=HEAD
the following env vars are set:If you think this is a good idea, but don't have the time, I'll try to make a PR for you Soon™️.