From b198e2cd05882c36dde180c0772a059e5bf52767 Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Fri, 24 Feb 2023 22:00:11 +0000 Subject: [PATCH 1/2] Add pre-commit hook for running addlicense --- .pre-commit-config.yaml | 4 ++++ .pre-commit-hooks.yaml | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 .pre-commit-hooks.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e4ae5d3e0a..f53e1fac08 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,3 +37,7 @@ repos: rev: 22.8.0 hooks: - id: black + - repo: . + rev: HEAD + hooks: + - id: addlicense diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 0000000000..eadb281d5e --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,5 @@ +- id: addlicense + name: Add copyright headers + entry: addlicense.sh + language: script + verbose: true From 5a628c769e18c7218f07eeda46f2cca25724029f Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Sat, 25 Feb 2023 03:37:28 +0000 Subject: [PATCH 2/2] fixup! Add pre-commit hook for running addlicense --- .pre-commit-config.yaml | 11 +++++++---- .pre-commit-hooks.yaml | 5 ----- 2 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 .pre-commit-hooks.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f53e1fac08..3b538b4aa0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: rev: 6.0.0 hooks: - id: buildifier - args: &args + args: &args # Keep this argument in sync with .bazelci/presubmit.yaml - --warnings=all - id: buildifier-lint @@ -30,14 +30,17 @@ repos: hooks: - id: isort name: isort (python) - args: + args: - --profile - black - repo: https://github.com/psf/black rev: 22.8.0 hooks: - id: black - - repo: . - rev: HEAD + - repo: local hooks: - id: addlicense + name: Add copyright headers + entry: addlicense.sh + types: [text] + language: script diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml deleted file mode 100644 index eadb281d5e..0000000000 --- a/.pre-commit-hooks.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- id: addlicense - name: Add copyright headers - entry: addlicense.sh - language: script - verbose: true