diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 869045d4..85e6853c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,9 @@ repos: - id: detect-private-key exclude: testdata - id: mixed-line-ending -- repo: . - rev: main +- repo: local hooks: - id: validate-copyright-year + name: Validate copyright year + entry: hack/check-copyright-year.sh + language: script diff --git a/hack/check-copyright-year.sh b/hack/check-copyright-year.sh index 45b0deb1..825b6511 100755 --- a/hack/check-copyright-year.sh +++ b/hack/check-copyright-year.sh @@ -1,3 +1,7 @@ +#!/bin/bash + +# Copyright 2021 the Pinniped contributors. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 # # Check if copyright statements include the current year # @@ -16,6 +20,6 @@ if [ -n "$missing_copyright_files" ]; then echo "$year is missing in the copyright notice of the following files:" for f in $missing_copyright_files; do echo " $f" - done + done exit 1 fi diff --git a/internal/controller/supervisorconfig/generator/supervisor_secrets_test.go b/internal/controller/supervisorconfig/generator/supervisor_secrets_test.go index 622ac6b6..f431ea76 100644 --- a/internal/controller/supervisorconfig/generator/supervisor_secrets_test.go +++ b/internal/controller/supervisorconfig/generator/supervisor_secrets_test.go @@ -1,4 +1,4 @@ -// Copyright 2020 the Pinniped contributors. All Rights Reserved. +// Copyright 2020-2021 the Pinniped contributors. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package generator @@ -25,7 +25,6 @@ import ( "go.pinniped.dev/internal/testutil" ) -// this is a comment var ( owner = &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{