Skip to content

Commit 2e2a957

Browse files
trallarddrammock
andcommitted
📝 Update documentation regarding formatting files
Co-authored-by: Daniel McCloy <[email protected]>
1 parent ace1586 commit 2e2a957

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

.git-blame-ignore-revs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
# commit hash here, so git blame can ignore the change.
33
#
44
# For more details, see:
5-
# https://git-scm.com/docs/git-config#Documentation/git-config.txt-blameignoreRevsFile
6-
# https://github.com/pydata/pydata-sphinx-theme/pull/713
5+
# https://pydata-sphinx-theme.readthedocs.io/en/stable/community/topics/attribution.html
76
#
87
90550b66ace16a370caa446e54698b126fda740b # initial black-format
98
236d4c6d1f10f5da064d929e9eb594daecf23551 # apply black 20.8b1 format

docs/community/topics/attribution.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
11
# Ignore formatting commits with `git blame`
22

3-
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.
3+
Please follow these steps to avoid obscuring files history when making commits that are
4+
strictly formatting/style changes (e.g., after running a new version of black or running
5+
pyupgrade after dropping an old Python version).
6+
7+
1. Create a new branch.
8+
2. Make any linting and formatting rules needed; either in the `pre-commit.config.yaml`
9+
or in the `pyproject.toml` file.
10+
3. Commit your changes with the `--no-verify` flag to skip the pre-commit hooks.
11+
4. Run the pre-commit hooks manually with `tox run -e lint` or `pre-commit run --all-files`.
12+
5. Commit the linting and formatting changes.
13+
6. Open a PR with these changes.
14+
15+
```{important}
16+
This PR **must** be rebased-merged -- instead of the default squash-merge we
17+
currently follow -- so a repository admin needs to enable this setting in the
18+
repository temporarily.
19+
20+
```
21+
22+
7. Open a new PR adding the commit hashes of the formatting commits to the `.git-blame-ignore-revs` file.
423

524
For more details, see:
625

7-
- https://git-scm.com/docs/git-config#Documentation/git-config.txt-blameignoreRevsFile
8-
- https://github.com/pydata/pydata-sphinx-theme/pull/713
26+
- <https://git-scm.com/docs/git-config#Documentation/git-config.txt-blameignoreRevsFile>
27+
- <https://github.com/pydata/pydata-sphinx-theme/pull/713>

0 commit comments

Comments
 (0)