File tree Expand file tree Collapse file tree 9 files changed +72
-5
lines changed Expand file tree Collapse file tree 9 files changed +72
-5
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,14 @@ test: ## Run unit tests
2323vet : # # Run go vet
2424 @go vet $(addprefix ./, $(SOURCE_DIRS ) )
2525
26- check : fmtcheck vet lint build test # # Pre-flight checks before creating PR
26+ tidy : # # Tidy go dependencies
27+ @go mod tidy
28+
29+ check-license : $(SOURCES )
30+ @./hack/check-license.sh " $( SOURCES) "
31+
32+ check : tidy fmtcheck vet lint build test check-license # # Pre-flight checks before creating PR
33+ @git diff --exit-code
2734
2835clean : # # Clean up your working environment
2936 @rm -f coverage-all.out coverage.out
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -o errexit
4+ set -o nounset
5+ set -o pipefail
6+
7+ echo " Checking for license header..."
8+ allfiles=$1
9+ licRes=" "
10+ for file in $allfiles ; do
11+ if ! head -n3 " ${file} " | grep -Eq " (Copyright|generated|GENERATED|Licensed)" ; then
12+ licRes=" ${licRes} \n" $( echo -e " ${file} " )
13+ fi
14+ done
15+ if [ -n " ${licRes} " ]; then
16+ echo -e " license header checking failed:\n${licRes} "
17+ exit 255
18+ fi
Original file line number Diff line number Diff line change 1- // Copyright 2019 The Operator-SDK Authors
1+ // Copyright 2020 The Operator-SDK Authors
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change 1- // Copyright 2018 The Operator-SDK Authors
1+ // Copyright 2020 The Operator-SDK Authors
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change 1- // Copyright 2018 The Operator-SDK Authors
1+ // Copyright 2020 The Operator-SDK Authors
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change 1+ // Copyright 2020 The Operator-SDK Authors
2+ //
3+ // Licensed under the Apache License, Version 2.0 (the "License");
4+ // you may not use this file except in compliance with the License.
5+ // You may obtain a copy of the License at
6+ //
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ //
9+ // Unless required by applicable law or agreed to in writing, software
10+ // distributed under the License is distributed on an "AS IS" BASIS,
11+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ // See the License for the specific language governing permissions and
13+ // limitations under the License.
14+
115package leader
216
317import (
Original file line number Diff line number Diff line change 1+ // Copyright 2020 The Operator-SDK Authors
2+ //
3+ // Licensed under the Apache License, Version 2.0 (the "License");
4+ // you may not use this file except in compliance with the License.
5+ // You may obtain a copy of the License at
6+ //
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ //
9+ // Unless required by applicable law or agreed to in writing, software
10+ // distributed under the License is distributed on an "AS IS" BASIS,
11+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ // See the License for the specific language governing permissions and
13+ // limitations under the License.
14+
115package leader
216
317import (
Original file line number Diff line number Diff line change 1- // Copyright 2019 The Operator-SDK Authors
1+ // Copyright 2020 The Operator-SDK Authors
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change 1+ // Copyright 2018 The Operator-SDK Authors
2+ //
3+ // Licensed under the Apache License, Version 2.0 (the "License");
4+ // you may not use this file except in compliance with the License.
5+ // You may obtain a copy of the License at
6+ //
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ //
9+ // Unless required by applicable law or agreed to in writing, software
10+ // distributed under the License is distributed on an "AS IS" BASIS,
11+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ // See the License for the specific language governing permissions and
13+ // limitations under the License.
14+
115package predicate
216
317import (
You can’t perform that action at this time.
0 commit comments