From 136f93ea052aeed008189749e16fa4f2b1f7fae8 Mon Sep 17 00:00:00 2001 From: Kazuyoshi Kato Date: Mon, 27 Dec 2021 09:38:43 -0800 Subject: [PATCH 1/3] hack: remove non-existent directories from golangci-lint's skip-dirs Signed-off-by: Kazuyoshi Kato --- hack/validate/golangci-lint.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/hack/validate/golangci-lint.yml b/hack/validate/golangci-lint.yml index 3aedf82a0c..9b60fdfdeb 100644 --- a/hack/validate/golangci-lint.yml +++ b/hack/validate/golangci-lint.yml @@ -24,10 +24,7 @@ linters: modules-download-mode: vendor skip-dirs: - - bundles - docs - # TODO: This package should be completely removed - - libnetwork/client/mflag linters-settings: govet: From 22f19f82439725ffa813e2bc42a2f62cd5f882d0 Mon Sep 17 00:00:00 2001 From: Kazuyoshi Kato Date: Mon, 27 Dec 2021 09:49:46 -0800 Subject: [PATCH 2/3] hack: do not exclude SQL-related checks moby doesn't have SQLs right now. Signed-off-by: Kazuyoshi Kato --- hack/validate/golangci-lint.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/hack/validate/golangci-lint.yml b/hack/validate/golangci-lint.yml index 9b60fdfdeb..b93b7620a4 100644 --- a/hack/validate/golangci-lint.yml +++ b/hack/validate/golangci-lint.yml @@ -82,9 +82,6 @@ issues: path: "api/types/(volume|container)/" linters: - golint - - text: "(G201|G202): SQL string (formatting|concatenation)" - linters: - - gosec # FIXME: evaluate these and fix where needed: G307: Deferring unsafe method "*os.File" on type "Close" (gosec) - text: "G307: Deferring unsafe method" linters: From 4bdc20844935c5995637b40bdb8152640d2e0c1f Mon Sep 17 00:00:00 2001 From: Kazuyoshi Kato Date: Mon, 27 Dec 2021 09:50:23 -0800 Subject: [PATCH 3/3] hack: remove a workaround for go-tools The false positive has been fixed. Signed-off-by: Kazuyoshi Kato --- hack/validate/golangci-lint.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/hack/validate/golangci-lint.yml b/hack/validate/golangci-lint.yml index b93b7620a4..661a85e385 100644 --- a/hack/validate/golangci-lint.yml +++ b/hack/validate/golangci-lint.yml @@ -98,11 +98,6 @@ issues: - text: "SA1019: httputil.ErrPersistEOF" linters: - staticcheck - # FIXME temporarily suppress these for false positives in tests (see https://github.com/dominikh/go-tools/issues/1022) - - text: "SA5011" - path: _test\.go - linters: - - staticcheck # This code is doing some fun stuff with reflect and it trips up the linter. - text: "field `foo` is unused" path: "libnetwork/options/options_test.go"