Skip to content

Commit

Permalink
Update addlicense to v1.0.0 and year 2021
Browse files Browse the repository at this point in the history
- Only files without the header will het the new year
- Generated files are skipped by the new version
- Pinned stringer to v0.1.5
- Pinned add license to v1.0.0
- Pinned golangci-lint to v1.40.1
- Extracted make install targets to reduce redundancy
  • Loading branch information
karlkfi committed Aug 25, 2021
1 parent f7e1391 commit 30c52a8
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 30 deletions.
23 changes: 14 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,28 @@ fix:
fmt:
go fmt ./...

generate:
(which $(GOPATH)/bin/stringer || go install golang.org/x/tools/cmd/stringer@a3eb095d6aeed806877423d9ef571b9a50ca8a2a) # latest as of 2021-05-27
install-stringer:
(which $(GOPATH)/bin/stringer || go install golang.org/x/tools/cmd/stringer@v0.1.5)

install-addlicense:
(which $(GOPATH)/bin/addlicense || go install github.com/google/addlicense@v1.0.0)

install-lint:
(which $(GOPATH)/bin/golangci-lint || go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.40.1)

generate: install-stringer
go generate ./...

license:
(which $(GOPATH)/bin/addlicense || go install github.com/google/addlicense@6d92264d717064f28b32464f0f9693a5b4ef0239) # latest as of 2021-05-27
$(GOPATH)/bin/addlicense -y 2020 -c "The Kubernetes Authors." -f LICENSE_TEMPLATE .
license: install-addlicense
$(GOPATH)/bin/addlicense -y 2021 -c "The Kubernetes Authors." -f LICENSE_TEMPLATE ./..

verify-license:
(which $(GOPATH)/bin/addlicense || go install github.com/google/addlicense@6d92264d717064f28b32464f0f9693a5b4ef0239) # latest as of 2021-05-27
verify-license: install-addlicense
$(GOPATH)/bin/addlicense -check .

tidy:
go mod tidy

lint:
(which $(GOPATH)/bin/golangci-lint || go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.40.1)
lint: install-lint
$(GOPATH)/bin/golangci-lint run ./...

test:
Expand Down
3 changes: 0 additions & 3 deletions pkg/apply/event/actiongroupeventtype_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions pkg/apply/event/applyeventoperation_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions pkg/apply/event/deleteeventoperation_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions pkg/apply/event/pruneeventoperation_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions pkg/apply/event/resourceaction_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions pkg/apply/event/type_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions pkg/kstatus/polling/event/eventtype_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 30c52a8

Please sign in to comment.