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

Bump golangci-lint to v1.20.0 #5572

Merged
merged 3 commits into from
Oct 10, 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
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download

KERNEL_VERSION ?= 4.15
# latest from https://github.com/golangci/golangci-lint/releases
GOLINT_VERSION ?= v1.18.0
GOLINT_VERSION ?= v1.20.0
# Limit number of default jobs, to avoid the CI builds running out of memory
GOLINT_JOBS ?= 4
# see https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint
GOLINT_GOGC ?= 8
GOLINT_GOGC ?= 100
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the reason for increasing 8 to 100 ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GOGC=100 is the default, so it is basically removing the increased garbage collection

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I restored the default, but I left the link to the docs in case that setting needs to be adjusted in the future.

# options for lint (golangci-lint)
GOLINT_OPTIONS = --deadline 4m \
GOLINT_OPTIONS = --timeout 4m \
--build-tags "${MINIKUBE_INTEGRATION_BUILD_TAGS}" \
--enable goimports,gocritic,golint,gocyclo,interfacer,misspell,nakedret,stylecheck,unconvert,unparam \
--exclude 'variable on range scope.*in function literal|ifElseChain'
Expand Down
4 changes: 0 additions & 4 deletions cmd/minikube/cmd/update-check.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ var updateCheckCmd = &cobra.Command{
Use: "update-check",
Short: "Print current and latest version number",
Long: `Print current and latest version number`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
// Explicitly disable update checking for the version command
enableUpdateNotification = false
},
Run: func(command *cobra.Command, args []string) {
url := notify.GithubMinikubeReleasesURL
r, err := notify.GetAllVersionsFromURL(url)
Expand Down
4 changes: 0 additions & 4 deletions cmd/minikube/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version of minikube",
Long: `Print the version of minikube.`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
// Explicitly disable update checking for the version command
enableUpdateNotification = false
},
Run: func(command *cobra.Command, args []string) {
out.Ln("minikube version: %v", version.GetVersion())
gitCommitID := version.GetGitCommitID()
Expand Down
8 changes: 4 additions & 4 deletions pkg/minikube/extract/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ func checkKeyValueExpression(kvp *ast.KeyValueExpr, e *state) {

// Ok now this is just a mess
if help, ok := kvp.Value.(*ast.BinaryExpr); ok {
s := checkBinaryExpression(help, e)
s := checkBinaryExpression(help)
if s != "" {
e.translations[s] = ""
}
Expand All @@ -394,7 +394,7 @@ func checkKeyValueExpression(kvp *ast.KeyValueExpr, e *state) {
}

// checkBinaryExpression checks binary expressions, stuff of the form x + y, for strings and concats them
func checkBinaryExpression(b *ast.BinaryExpr, e *state) string {
func checkBinaryExpression(b *ast.BinaryExpr) string {
// Check the left side
var s string
if l, ok := b.X.(*ast.BasicLit); ok {
Expand All @@ -410,7 +410,7 @@ func checkBinaryExpression(b *ast.BinaryExpr, e *state) string {
}

if b1, ok := b.X.(*ast.BinaryExpr); ok {
if x := checkBinaryExpression(b1, e); x != "" {
if x := checkBinaryExpression(b1); x != "" {
s += x
}
}
Expand All @@ -429,7 +429,7 @@ func checkBinaryExpression(b *ast.BinaryExpr, e *state) string {
}

if b1, ok := b.Y.(*ast.BinaryExpr); ok {
if x := checkBinaryExpression(b1, e); x != "" {
if x := checkBinaryExpression(b1); x != "" {
s += x
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/minikube/tunnel/tunnel_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ func (mgr *Manager) run(ctx context.Context, t controller, ready, check, done ch
}
}

func (mgr *Manager) cleanup(t controller) *Status {
return t.cleanup()
func (mgr *Manager) cleanup(t controller) {
t.cleanup()
}

// CleanupNotRunningTunnels cleans up tunnels that are not running
Expand Down