mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-17 09:49:13 +00:00
fix lint error
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
run:
|
run:
|
||||||
deadline: 5m
|
deadline: 5m
|
||||||
|
skip-dirs:
|
||||||
|
- yaml/internal/k8sgen/pkg
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
# please, do not use `enable-all`: it's deprecated and will be removed soon.
|
# please, do not use `enable-all`: it's deprecated and will be removed soon.
|
||||||
@@ -12,7 +14,7 @@ linters:
|
|||||||
- bodyclose
|
- bodyclose
|
||||||
- deadcode
|
- deadcode
|
||||||
- depguard
|
- depguard
|
||||||
- dogsled
|
# - dogsled # uncomment after upgrading golangci-lint (Issue #3663)
|
||||||
- dupl
|
- dupl
|
||||||
- errcheck
|
- errcheck
|
||||||
- gochecknoinits
|
- gochecknoinits
|
||||||
@@ -39,7 +41,7 @@ linters:
|
|||||||
- unparam
|
- unparam
|
||||||
- unused
|
- unused
|
||||||
- varcheck
|
- varcheck
|
||||||
- whitespace
|
# - whitespace # uncomment after upgrading golangci-lint (Issue #3663)
|
||||||
|
|
||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
|
|||||||
@@ -9,8 +9,10 @@ export PATH := $(MYGOBIN):$(PATH)
|
|||||||
$(MYGOBIN)/addlicense:
|
$(MYGOBIN)/addlicense:
|
||||||
go get github.com/google/addlicense
|
go get github.com/google/addlicense
|
||||||
|
|
||||||
|
# TODO: Issue #3663
|
||||||
|
# Update this version of golangci-lint
|
||||||
$(MYGOBIN)/golangci-lint:
|
$(MYGOBIN)/golangci-lint:
|
||||||
go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.19.1
|
go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.17.0
|
||||||
|
|
||||||
$(MYGOBIN)/k8scopy:
|
$(MYGOBIN)/k8scopy:
|
||||||
( cd ../cmd/k8scopy; go install . )
|
( cd ../cmd/k8scopy; go install . )
|
||||||
@@ -30,9 +32,9 @@ clean:
|
|||||||
|
|
||||||
lint: $(MYGOBIN)/golangci-lint
|
lint: $(MYGOBIN)/golangci-lint
|
||||||
$(MYGOBIN)/golangci-lint \
|
$(MYGOBIN)/golangci-lint \
|
||||||
--skip-dirs $(k8sGenDir) \
|
|
||||||
run ./...
|
run ./...
|
||||||
|
|
||||||
|
|
||||||
license: $(MYGOBIN)/addlicense
|
license: $(MYGOBIN)/addlicense
|
||||||
$(MYGOBIN)/addlicense \
|
$(MYGOBIN)/addlicense \
|
||||||
-y 2021 \
|
-y 2021 \
|
||||||
|
|||||||
15
kyaml/go.mod
15
kyaml/go.mod
@@ -21,3 +21,18 @@ require (
|
|||||||
gopkg.in/yaml.v2 v2.3.0
|
gopkg.in/yaml.v2 v2.3.0
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// These can be removed after upgrading golangci-lint (Issue #3663)
|
||||||
|
replace github.com/go-critic/go-critic v0.0.0-20181204210945-c3db6069acc5 => github.com/go-critic/go-critic v0.0.0-20190422201921-c3db6069acc5
|
||||||
|
|
||||||
|
replace github.com/golangci/errcheck v0.0.0-20181003203344-ef45e06d44b6 => github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6
|
||||||
|
|
||||||
|
replace github.com/golangci/go-tools v0.0.0-20180109140146-af6baa5dc196 => github.com/golangci/go-tools v0.0.0-20190318060251-af6baa5dc196
|
||||||
|
|
||||||
|
replace github.com/golangci/gofmt v0.0.0-20181105071733-0b8337e80d98 => github.com/golangci/gofmt v0.0.0-20181222123516-0b8337e80d98
|
||||||
|
|
||||||
|
replace github.com/golangci/gosec v0.0.0-20180901114220-66fb7fc33547 => github.com/golangci/gosec v0.0.0-20190211064107-66fb7fc33547
|
||||||
|
|
||||||
|
replace github.com/golangci/lint-1 v0.0.0-20180610141402-ee948d087217 => github.com/golangci/lint-1 v0.0.0-20190420132249-ee948d087217
|
||||||
|
|
||||||
|
replace mvdan.cc/unparam v0.0.0-20190124213536-fbb59629db34 => mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34
|
||||||
@@ -169,13 +169,13 @@ func (m Merger) SetComments(sources walk.Sources) error {
|
|||||||
// avoid panic
|
// avoid panic
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if source != nil && source.YNode().FootComment != "" {
|
if source.YNode().FootComment != "" {
|
||||||
dest.YNode().FootComment = source.YNode().FootComment
|
dest.YNode().FootComment = source.YNode().FootComment
|
||||||
}
|
}
|
||||||
if source != nil && source.YNode().HeadComment != "" {
|
if source.YNode().HeadComment != "" {
|
||||||
dest.YNode().HeadComment = source.YNode().HeadComment
|
dest.YNode().HeadComment = source.YNode().HeadComment
|
||||||
}
|
}
|
||||||
if source != nil && source.YNode().LineComment != "" {
|
if source.YNode().LineComment != "" {
|
||||||
dest.YNode().LineComment = source.YNode().LineComment
|
dest.YNode().LineComment = source.YNode().LineComment
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user