Skip to content

Commit 7686989

Browse files
confine pre-commit to stages (psf#3940)
See https://pre-commit.com/#confining-hooks-to-run-at-certain-stages > If you are authoring a tool, it is usually a good idea to provide an appropriate `stages` property. For example a reasonable setting for a linter or code formatter would be `stages: [pre-commit, pre-merge-commit, pre-push, manual]`. Co-authored-by: Jelle Zijlstra <[email protected]>
1 parent 53c4278 commit 7686989

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

.pre-commit-hooks.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
name: black
55
description: "Black: The uncompromising Python code formatter"
66
entry: black
7+
stages: [pre-commit, pre-merge-commit, pre-push, manual]
78
language: python
89
minimum_pre_commit_version: 2.9.2
910
require_serial: true
@@ -13,6 +14,7 @@
1314
description:
1415
"Black: The uncompromising Python code formatter (with Jupyter Notebook support)"
1516
entry: black
17+
stages: [pre-commit, pre-merge-commit, pre-push, manual]
1618
language: python
1719
minimum_pre_commit_version: 2.9.2
1820
require_serial: true

CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545

4646
<!-- For example, Docker, GitHub Actions, pre-commit, editors -->
4747

48+
- Black's pre-commit integration will now run only on git hooks appropriate for a code
49+
formatter (#3940)
50+
4851
### Documentation
4952

5053
<!-- Major changes to documentation and policies. Small docs changes

0 commit comments

Comments
 (0)