Skip to content

Commit 36454ed

Browse files
authored
Merge pull request kubernetes#2388 from justaugustus/moar-verify
Update code OWNERS and add more verify scripts
2 parents 4bedad8 + ecd52f2 commit 36454ed

30 files changed

+1194
-73
lines changed

.githooks/OWNERS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# See the OWNERS docs at https://go.k8s.io/owners
2+
3+
approvers:
4+
- kep-tools-approvers
5+
reviewers:
6+
- kep-tools-reviewers
7+
8+
labels:
9+
- area/enhancements

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Verify scripts may leave programs in this directory
2+
bin/
3+
14
# OSX leaves these everywhere on SMB shares
25
._*
36

.golangci.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
---
2+
run:
3+
concurrency: 6
4+
deadline: 5m
5+
issues:
6+
exclude-rules:
7+
# counterfeiter fakes are usually named 'fake_<something>.go'
8+
- path: fake_.*\.go
9+
linters:
10+
- gocritic
11+
- golint
12+
- dupl
13+
linters:
14+
disable-all: true
15+
enable:
16+
- asciicheck
17+
- bodyclose
18+
- deadcode
19+
- depguard
20+
- dogsled
21+
- dupl
22+
- errcheck
23+
- goconst
24+
- gocritic
25+
- gocyclo
26+
- godox
27+
- gofmt
28+
- gofumpt
29+
- goheader
30+
- goimports
31+
- golint
32+
- gomodguard
33+
- goprintffuncname
34+
- gosimple
35+
- govet
36+
- ineffassign
37+
- interfacer
38+
- maligned
39+
- misspell
40+
- nakedret
41+
- prealloc
42+
- rowserrcheck
43+
- sqlclosecheck
44+
- staticcheck
45+
- structcheck
46+
- stylecheck
47+
- typecheck
48+
- unconvert
49+
- unparam
50+
- unused
51+
- varcheck
52+
- whitespace
53+
linters-settings:
54+
godox:
55+
keywords:
56+
- BUG
57+
- FIXME
58+
- HACK
59+
errcheck:
60+
check-type-assertions: true
61+
check-blank: true
62+
gocritic:
63+
enabled-checks:
64+
# Diagnostic
65+
- appendAssign
66+
- argOrder
67+
- badCond
68+
- caseOrder
69+
- codegenComment
70+
- commentedOutCode
71+
- deprecatedComment
72+
- dupArg
73+
- dupBranchBody
74+
- dupCase
75+
- dupSubExpr
76+
- exitAfterDefer
77+
- flagDeref
78+
- flagName
79+
- nilValReturn
80+
- offBy1
81+
- sloppyReassign
82+
- weakCond
83+
- octalLiteral
84+
85+
# Performance
86+
- appendCombine
87+
- equalFold
88+
- hugeParam
89+
- indexAlloc
90+
- rangeExprCopy
91+
- rangeValCopy
92+
93+
# Style
94+
- assignOp
95+
- boolExprSimplify
96+
- captLocal
97+
- commentFormatting
98+
- commentedOutImport
99+
- defaultCaseOrder
100+
- docStub
101+
- elseif
102+
- emptyFallthrough
103+
- emptyStringTest
104+
- hexLiteral
105+
- methodExprCall
106+
- regexpMust
107+
- singleCaseSwitch
108+
- sloppyLen
109+
- stringXbytes
110+
- switchTrue
111+
- typeAssertChain
112+
- typeSwitchVar
113+
- underef
114+
- unlabelStmt
115+
- unlambda
116+
- unslice
117+
- valSwap
118+
- wrapperFunc
119+
- yodaStyleExpr
120+
# - ifElseChain
121+
122+
# Opinionated
123+
- builtinShadow
124+
- importShadow
125+
- initClause
126+
- nestingReduce
127+
- paramTypeCombine
128+
- ptrToRefParam
129+
- typeUnparen
130+
- unnamedResult
131+
- unnecessaryBlock

Makefile

Lines changed: 107 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,127 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# If you update this file, please follow
16+
# https://suva.sh/posts/well-documented-makefiles
17+
1518
REPO_ROOT := $(shell git rev-parse --show-toplevel)
1619

17-
.DEFAULT_GOAL := help
20+
.DEFAULT_GOAL:=help
21+
SHELL:=/usr/bin/env bash
1822

19-
.PHONY: targets
20-
targets: help verify verify-toc verify-spelling verify-metadata update-toc add-verify-hook
23+
COLOR:=\\033[36m
24+
NOCOLOR:=\\033[0m
2125

22-
help: ## Show this help text.
23-
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
24-
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
26+
##@ KEPs
2527

26-
verify: ## Runs all verification tests.
27-
${REPO_ROOT}/hack/verify.sh
28+
.PHONY: update-toc verify-toc verify-metadata
29+
30+
update-toc: ## Updates KEP Table of Contents.
31+
${REPO_ROOT}/hack/update-toc.sh
2832

2933
verify-toc: ## Verifies the Table of Contents is in the correct format.
3034
${REPO_ROOT}/hack/verify-toc.sh
3135

32-
verify-spelling: ## Verifies spelling.
33-
${REPO_ROOT}/hack/verify-spelling.sh
34-
3536
verify-metadata: ## Verifies the KEP metadata is valid yaml.
3637
${REPO_ROOT}/hack/verify-kep-metadata.sh
3738

38-
update-toc: ## Updates KEP Table of Contents.
39-
${REPO_ROOT}/hack/update-toc.sh
39+
##@ Verify
40+
41+
.PHONY: add-verify-hook verify verify-boilerplate verify-build verify-golangci-lint verify-go-mod verify-shellcheck verify-spelling
4042

4143
add-verify-hook: ## Adds verify scripts to git pre-commit hooks.
4244
# Note: The pre-commit hooks can be bypassed by using the flag --no-verify when
4345
# performing a git commit.
4446
git config --local core.hooksPath "${REPO_ROOT}/.githooks"
47+
48+
# TODO(verify): Reconcile with duplicate target
49+
verify: ## Runs all verification tests.
50+
${REPO_ROOT}/hack/verify.sh
51+
52+
# TODO(lint): Uncomment verify-shellcheck once we finish shellchecking the repo.
53+
verify: tools verify-boilerplate verify-build verify-golangci-lint verify-go-mod #verify-shellcheck ## Runs verification scripts to ensure correct execution
54+
55+
verify-boilerplate: ## Runs the file header check
56+
${REPO_ROOT}/hack/verify-boilerplate.sh
57+
58+
verify-build: ## Builds the project for a chosen set of platforms
59+
${REPO_ROOT}/hack/verify-build.sh
60+
61+
verify-go-mod: ## Runs the go module linter
62+
${REPO_ROOT}/hack/verify-go-mod.sh
63+
64+
verify-golangci-lint: ## Runs all golang linters
65+
${REPO_ROOT}/hack/verify-golangci-lint.sh
66+
67+
verify-shellcheck: ## Runs shellcheck
68+
${REPO_ROOT}/hack/verify-shellcheck.sh
69+
70+
verify-spelling: ## Verifies spelling.
71+
${REPO_ROOT}/hack/verify-spelling.sh
72+
73+
##@ Tests
74+
75+
.PHONY: test test-go-unit test-go-integration
76+
77+
test: test-go-unit ## Runs unit tests
78+
79+
test-go-unit: ## Runs Golang unit tests
80+
${REPO_ROOT}/hack/test-go.sh
81+
82+
test-go-integration: ## Runs Golang integration tests
83+
${REPO_ROOT}/hack/test-go-integration.sh
84+
85+
##@ Tools
86+
87+
.PHONY: tools
88+
89+
KEP_TOOLS ?=
90+
91+
tools: ## Compiles a set of KEP tools, specified by $KEP_TOOLS
92+
./compile-tools $(KEP_TOOLS)
93+
94+
##@ Dependencies
95+
96+
.SILENT: update-deps update-deps-go update-mocks
97+
.PHONY: update-deps update-deps-go update-mocks
98+
99+
update-deps: update-deps-go ## Update all dependencies for this repo
100+
echo -e "${COLOR}Commit/PR the following changes:${NOCOLOR}"
101+
git status --short
102+
103+
update-deps-go: GO111MODULE=on
104+
update-deps-go: ## Update all golang dependencies for this repo
105+
go get -u -t ./...
106+
go mod tidy
107+
go mod verify
108+
$(MAKE) test-go-unit
109+
${REPO_ROOT}/hack/update-all.sh
110+
111+
update-mocks: ## Update all generated mocks
112+
go generate ./...
113+
for f in $(shell find . -name fake_*.go); do \
114+
cp hack/boilerplate/boilerplate.go.txt tmp ;\
115+
sed -i.bak -e 's/YEAR/'$(shell date +"%Y")'/g' -- tmp && rm -- tmp.bak ;\
116+
cat $$f >> tmp ;\
117+
mv tmp $$f ;\
118+
done
119+
120+
##@ Helpers
121+
122+
.PHONY: help
123+
124+
help: ## Display this help
125+
@awk \
126+
-v "col=${COLOR}" -v "nocol=${NOCOLOR}" \
127+
' \
128+
BEGIN { \
129+
FS = ":.*##" ; \
130+
printf "\nUsage:\n make %s<target>%s\n", col, nocol \
131+
} \
132+
/^[a-zA-Z_-]+:.*?##/ { \
133+
printf " %s%-15s%s %s\n", col, $$1, nocol, $$2 \
134+
} \
135+
/^##@/ { \
136+
printf "\n%s%s%s\n", col, substr($$0, 5), nocol \
137+
} \
138+
' $(MAKEFILE_LIST)

OWNERS_ALIASES

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ aliases:
6363
- derekwaynecarr
6464
sig-release-leads:
6565
- alejandrox1
66+
- hasheddan
6667
- justaugustus
6768
- saschagrunert
68-
- tpepper
6969
sig-scalability-leads:
7070
- mm4tt
7171
- shyamjvs
@@ -74,11 +74,11 @@ aliases:
7474
- Huang-Wei
7575
- ahg-g
7676
sig-security-leads:
77-
- iancoldwater
77+
- IanColdwater
7878
- tabbysable
7979
sig-service-catalog-leads:
8080
- jberkhahn
81-
- mszostok
81+
- jhvhs
8282
sig-storage-leads:
8383
- jsafrane
8484
- msau42
@@ -117,11 +117,6 @@ aliases:
117117
- bartsmykla
118118
- dims
119119
- spiffxp
120-
wg-lts-leads:
121-
- imkin
122-
- quinton-hoole
123-
- tpepper
124-
- youngnick
125120
wg-multitenancy-leads:
126121
- srampal
127122
- tashimi
@@ -164,10 +159,10 @@ aliases:
164159
- cblecker
165160
- derekwaynecarr
166161
- dims
167-
- lachie83
162+
- liggitt
163+
- mrbobbytables
168164
- nikhita
169165
- parispittman
170-
- spiffxp
171166
## BEGIN CUSTOM CONTENT
172167
enhancements-approvers:
173168
- jeremyrickard
@@ -181,6 +176,16 @@ aliases:
181176
- justaugustus
182177
- LappleApple
183178
- mrbobbytables
179+
kep-tools-approvers:
180+
- jeremyrickard
181+
- johnbelamaric
182+
- justaugustus
183+
- mrbobbytables
184+
kep-tools-reviewers:
185+
- jeremyrickard
186+
- johnbelamaric
187+
- justaugustus
188+
- mrbobbytables
184189
prod-readiness-approvers:
185190
- johnbelamaric
186191
- deads2k

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Enhancement Tracking and Backlog
22

3-
## Table of Contents
3+
[![PkgGoDev](https://pkg.go.dev/badge/k8s.io/enhancements)](https://pkg.go.dev/k8s.io/enhancements)
4+
[![Go Report Card](https://goreportcard.com/badge/k8s.io/enhancements)](https://goreportcard.com/report/k8s.io/enhancements)
5+
[![Slack](https://img.shields.io/badge/Slack-%23enhancements-blueviolet)](https://kubernetes.slack.com/archives/C1L57L91V)
6+
47
- [Is My Thing an Enhancement?](#is-my-thing-an-enhancement)
58
- [When to Create a New Enhancement Issue](#when-to-create-a-new-enhancement-issue)
69
- [Why Are Enhancements Tracked](#why-are-enhancements-tracked)

api/OWNERS

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# See the OWNERS docs at https://go.k8s.io/owners
2+
3+
options:
4+
no_parent_owners: true
5+
6+
approvers:
7+
- kep-tools-approvers
8+
reviewers:
9+
- kep-tools-reviewers
10+
11+
labels:
12+
- area/enhancements
13+
- kind/api-change

cmd/OWNERS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# See the OWNERS docs at https://go.k8s.io/owners
2+
3+
approvers:
4+
- kep-tools-approvers
5+
reviewers:
6+
- kep-tools-reviewers
7+
8+
labels:
9+
- area/enhancements

0 commit comments

Comments
 (0)