confine pre-commit to stages (#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 <jelle.zijlstra@gmail.com>
This commit is contained in:
David Culley 2023-10-28 00:43:34 +02:00 committed by GitHub
parent 53c4278a4c
commit 7686989fc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -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
@ -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

View File

@ -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