Ignore formatting commits with git blame
#
Please follow these steps to avoid obscuring file history when making commits that are strictly formatting/style changes (e.g., after running a new version of black or running pyupgrade after dropping an old Python version).
Create a new branch.
Make any linting and formatting rules needed; either in the
pre-commit.config.yaml
or in thepyproject.toml
file.Commit your changes with the
--no-verify
flag to skip the pre-commit hooks.Run the pre-commit hooks manually with
tox run -e lint
orpre-commit run --all-files
.Commit the linting and formatting changes.
Open a PR with these changes.
Important
This PR must be rebase-merged – instead of the default squash-merge we currently follow – so a repository admin needs to enable this setting in the repository temporarily.
Open a new PR adding the commit hashes of the formatting commits to the
.git-blame-ignore-revs
file.
For more details, see: