When I was developing sktime, we sometimes had new contributors who opened a PR but forgot to set up pre-commit.
This is how you can run pre-commit retrospectively on all changed files in the PR from a <feature-branch>
into main
.
First make sure that main
is up-to-date, so that your local git state reflects the PR on the remote repository.
If you are working with a fork, take a look at GitHub’s guide on how to sync a fork.
Then run the following:
git checkout <feature-branch>
pre-commit run --files $(git diff --name-only HEAD main)