From 6dbb30e67cdb84efa24c33654316eb916ab6c53e Mon Sep 17 00:00:00 2001 From: Grant Garr Date: Wed, 8 Nov 2023 00:30:47 -0600 Subject: [PATCH] confine pre-commit to stages 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]`. Originally done upstream in https://github.com/psf/black/pull/3940 --- .pre-commit-hooks.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 1379570..6c33603 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -2,6 +2,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 @@ -11,6 +12,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