Skip to content
Open
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
1 change: 1 addition & 0 deletions cmd/kind/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package app is the implementation of the kind application.
package app

import (
Expand Down
1 change: 1 addition & 0 deletions cmd/kind/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package main is the main entrypoint for the kind cli.
package main

import (
Expand Down
2 changes: 1 addition & 1 deletion hack/make-rules/verify/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ source hack/build/setup-go.sh

# build golangci-lint
cd "${REPO_ROOT}/hack/tools"
go build -o "${REPO_ROOT}"/bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint
go build -o "${REPO_ROOT}"/bin/golangci-lint github.com/golangci/golangci-lint/v2/cmd/golangci-lint
cd "${REPO_ROOT}"

# first for the repo in general
Expand Down
65 changes: 47 additions & 18 deletions hack/tools/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,62 @@
version: "2"

run:
timeout: 3m

linters:
disable-all: true
default: none

enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- gochecknoinits
- gofmt
- revive # replaces golint for now
- misspell
- exportloopref
- unparam

linters-settings:
staticcheck:
checks:
- all
settings:
staticcheck:
checks:
- all
revive:
rules:
- name: var-naming
arguments:
- []
- []
- - skip-package-name-checks: true

exclusions:
presets:
- std-error-handling
- common-false-positives
rules:
# this requires renaming all unused parameters, we'd rather leave a preferred
# placeholder name in place when implementing an interface etc.
# we can revisit this later, right now it's generating a lot of new warnings
# after upgrading golangci-lint
- linters:
- revive
text: "^unused-parameter: .*"
# Not all package docstrings add value, so we do not want to enforce it
- linters:
- revive
text: "package-comments: should have a package comment"
- linters:
- staticcheck
text: "ST1000: at least one file in a package should have a package comment"
- linters:
- staticcheck
path: pkg/cmd
text: "ST1005: error strings should not be capitalized"
- linters:
- staticcheck
path: images/kindnetd/cmd
text: "ST1005: error strings should not be capitalized"

formatters:
enable:
- gofmt

issues:
exclude-rules:
# this requires renaming all unused parameters, we'd rather leave a preferred
# placeholder name in place when implementing an interface etc.
# we can revisit this later, right now it's generating a lot of new warnings
# after upgrading golangci-lint
- text: "^unused-parameter: .*"
linters:
- revive
Loading
Loading