-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOC - Update documentation regarding formatting files (#2057)
First, thanks @drammock, for helping with the lining issues 💜 Since we had some hiccups dealing with these PRs/items I decided to update our docs to include the suggested workflow (I added @drammock as a co-author since he helped figure out what this looked like) --------- Co-authored-by: Daniel McCloy <[email protected]>
- Loading branch information
Showing
2 changed files
with
23 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,27 @@ | ||
# Ignore formatting commits with `git blame` | ||
|
||
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), add the commit hash to `.git-blame-ignore-revs`, so `git blame` can ignore the change. | ||
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). | ||
|
||
1. Create a new branch. | ||
2. Make any linting and formatting rules needed; either in the `pre-commit.config.yaml` | ||
or in the `pyproject.toml` file. | ||
3. Commit your changes with the `--no-verify` flag to skip the pre-commit hooks. | ||
4. Run the pre-commit hooks manually with `tox run -e lint` or `pre-commit run --all-files`. | ||
5. Commit the linting and formatting changes. | ||
6. 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. | ||
``` | ||
|
||
7. Open a new PR adding the commit hashes of the formatting commits to the `.git-blame-ignore-revs` file. | ||
|
||
For more details, see: | ||
|
||
- https://git-scm.com/docs/git-config#Documentation/git-config.txt-blameignoreRevsFile | ||
- https://github.com/pydata/pydata-sphinx-theme/pull/713 | ||
- <https://git-scm.com/docs/git-config#Documentation/git-config.txt-blameignoreRevsFile> | ||
- <https://github.com/pydata/pydata-sphinx-theme/pull/713> |