File tree Expand file tree Collapse file tree 5 files changed +77
-1
lines changed Expand file tree Collapse file tree 5 files changed +77
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,23 @@ test: ## Run unit tests
23
23
vet : # # Run go vet
24
24
@go vet $(addprefix ./, $(SOURCE_DIRS ) )
25
25
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
+ fake :
33
+ # for f in $^ ; do \
34
+ # if ! head -n3 "$${f}" | grep -Eq "(Copyright|generated|GENERATED|Licensed)" ; then \
35
+ # licRes="$${licRes}\n"$(echo -e " $${f}") \
36
+ # fi \
37
+ # done
38
+ @# echo $(SOURCES)
39
+ @# @for f in $(SOURCES); do echo $$(f); done
40
+
41
+ check : tidy fmtcheck vet lint build test check-license # # Pre-flight checks before creating PR
42
+ @git diff --exit-code
27
43
28
44
clean : # # Clean up your working environment
29
45
@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 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
+
1
15
package leader
2
16
3
17
import (
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
+
1
15
package leader
2
16
3
17
import (
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
+
1
15
package predicate
2
16
3
17
import (
You can’t perform that action at this time.
0 commit comments