Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add verify-gomod and verify-goimports to Travis job #7952

Merged
merged 3 commits into from
Nov 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ ci: govet verify-gofmt verify-gomod verify-goimports verify-boilerplate verify-b
# govet: covered by pull-kops-verify-govet
# verify-boilerplate: covered by pull-kops-verify-boilerplate
.PHONY: travis-ci
travis-ci: verify-misspelling nodeup examples test | verify-gendocs verify-packages verify-apimachinery
travis-ci: verify-misspelling verify-gomod verify-goimports nodeup examples test | verify-gendocs verify-packages verify-apimachinery
echo "Done!"

.PHONY: pr
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ require (
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529
golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a
golang.org/x/tools v0.0.0-20191124021906-f5828fc9a103 // indirect
golang.org/x/tools v0.0.0-20191124021906-f5828fc9a103
google.golang.org/api v0.0.0-20181220000619-583d854617af
gopkg.in/gcfg.v1 v1.2.0
gopkg.in/inf.v0 v0.9.1
Expand Down
10 changes: 10 additions & 0 deletions hack/verify-goimports
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ for package in packages:
continue
paths.append(package)

# Install goimports from vendor
print('installing goimports from vendor')

process = subprocess.Popen(['go', 'install', 'k8s.io/kops/vendor/golang.org/x/tools/cmd/goimports'], stdout=subprocess.PIPE, cwd=path.join(gopath, 'src'))
stdout, stderr = process.communicate()
if process.returncode != 0:
print("FAIL: installing goimports from vendor failed")
print(stderr)
sys.exit(1)

print("packages %s" % paths)

env = os.environ
Expand Down
2 changes: 2 additions & 0 deletions tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (

_ "github.com/client9/misspell/cmd/misspell"

_ "golang.org/x/tools/cmd/goimports"

_ "honnef.co/go/tools/cmd/staticcheck"

_ "sigs.k8s.io/controller-tools/cmd/controller-gen"
Expand Down
20 changes: 20 additions & 0 deletions vendor/golang.org/x/tools/cmd/goimports/BUILD.bazel

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

43 changes: 43 additions & 0 deletions vendor/golang.org/x/tools/cmd/goimports/doc.go

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

Loading