Skip to content

Commit 87e729f

Browse files
committedSep 11, 2023
Add script for separate commits for each file updated by black.
1 parent 9f670bf commit 87e729f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
 

‎admin/black_separate_commits.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
# This is a helper for creating a separate commit for every file that was
3+
# automatically updated by black.
4+
#
5+
# This is designed to be used after black was updated and it needs to
6+
# change many files at once.
7+
#
8+
# To use this script:
9+
# * Update the black version in .pre-commit-config.yaml
10+
# * Commit the .pre-commit-config.yaml change
11+
# * Run `pre-commit run --all`
12+
# * Run this script.
13+
#
14+
for file in $(git diff --name-only)
15+
do
16+
git commit -m "Black auto-update: $file." $file
17+
done

0 commit comments

Comments
 (0)
Please sign in to comment.