Skip to content

Commit 0ca9913

Browse files
trallarddrammock
andauthored
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]>
1 parent a009a24 commit 0ca9913

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

.git-blame-ignore-revs

+1-2
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

+22-3
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 file 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 rebase-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)