Skip to content

Commit

Permalink
confine pre-commit to stages (psf#3940)
Browse files Browse the repository at this point in the history
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 <jelle.zijlstra@gmail.com>
  • Loading branch information
davidculley and JelleZijlstra authored Oct 27, 2023
1 parent 53c4278 commit 7686989
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
name: black
description: "Black: The uncompromising Python code formatter"
entry: black
stages: [pre-commit, pre-merge-commit, pre-push, manual]
language: python
minimum_pre_commit_version: 2.9.2
require_serial: true
Expand All @@ -13,6 +14,7 @@
description:
"Black: The uncompromising Python code formatter (with Jupyter Notebook support)"
entry: black
stages: [pre-commit, pre-merge-commit, pre-push, manual]
language: python
minimum_pre_commit_version: 2.9.2
require_serial: true
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@

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

- Black's pre-commit integration will now run only on git hooks appropriate for a code
formatter (#3940)

### Documentation

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

0 comments on commit 7686989

Please sign in to comment.