Skip to content
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
130 changes: 130 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
run:
timeout: 10m
skip-dirs:
- ^bin/
- ^data/data/
- ^docs/
- ^hack/
- ^images/
- ^scripts/
- ^terraform/
- ^upi/
go: '1.18'
modules-download-mode: vendor
output:
print-linter-name: true
sort-results: true
uniq-by-line: false
linters:
enable:
- asciicheck
- containedctx
- decorder
- depguard
- dogsled
- errcheck
- errorlint
- exportloopref
- goconst
- gocritic
- gocyclo
- godot
- gofmt
- goimports
- gosec
- gosimple
- govet
- importas
- ineffassign
- misspell
- nakedret
- prealloc
- predeclared
- revive
- staticcheck
- stylecheck
- tenv
- thelper
- typecheck
- unconvert
- unused
- whitespace
linters-settings:
errcheck:
# Report about not checking of errors in type assertions: `a := b.(MyStruct)`.
# Such cases aren't reported by default.
# Default: false
check-type-assertions: true
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`.
# Such cases aren't reported by default.
# Default: false
check-blank: true
# DEPRECATED comma-separated list of pairs of the form pkg:regex
#
# the regex is used to ignore names within pkg. (default "fmt:.*").
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
ignore: fmt:.*,io/ioutil:^Read.*
# To disable the errcheck built-in exclude list.
# See `-excludeonly` option in https://github.com/kisielk/errcheck#excluding-functions for details.
# Default: false
disable-default-exclusions: true
# DEPRECATED use exclude-functions instead.
#
# Path to a file containing a list of functions to exclude from checking.
# See https://github.com/kisielk/errcheck#excluding-functions for details.
# exclude: /path/to/file.txt
# List of functions to exclude from checking, where each entry is a single function to exclude.
# See https://github.com/kisielk/errcheck#excluding-functions for details.
exclude-functions:
- io/ioutil.ReadFile
- io.Copy(*bytes.Buffer)
- io.Copy(os.Stdout)
errorlint:
# Check whether fmt.Errorf uses the %w verb for formatting errors.
# See the https://github.com/polyfloyd/go-errorlint for caveats.
# Default: true
errorf: true
# Check for plain type assertions and type switches.
# Default: true
asserts: true
# Check for plain error comparisons.
# Default: true
comparison: true
gci:
# DEPRECATED: use `sections` and `prefix(github.com/org/project)` instead.
# local-prefixes: github.com/org/project
#
# Section configuration to compare against.
# Section names are case-insensitive and may contain parameters in ().
# The default order of sections is `standard > default > custom > blank > dot`,
# If `custom-order` is `true`, it follows the order of `sections` option.
# Default: ["standard", "default"]
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/openshift) # Custom section: groups all imports with the specified Prefix.
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
# - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
# Skip generated files.
# Default: true
skip-generated: true
# Enable custom order of sections.
# If `true`, make the section order the same as the order of `sections`.
# Default: false
custom-order: true
gofumpt:
# Select the Go version to target.
# Default: "1.15"
# Deprecated: use the global `run.go` instead.
# lang-version: "1.17"
# Module path which contains the source code being formatted.
# Default: ""
module-path: github.com/openshift/installer
# Choose whether to use the extra rules.
# Default: false
extra-rules: true
goimports:
# Put imports beginning with prefix after 3rd-party packages.
# It's a comma-separated list of prefixes.
# Default: ""
local-prefixes: github.com/openshift
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ require (
github.com/vincent-petithory/dataurl v1.0.0
github.com/vmware/govmomi v0.27.4
golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec
google.golang.org/api v0.91.0
Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1592,7 +1592,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
Expand Down
11 changes: 3 additions & 8 deletions hack/go-lint.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
#!/bin/sh
# Example: ./hack/go-lint.sh installer/... pkg/... tests/smoke

if [ "$IS_CONTAINER" != "" ]; then
GOFLAGS="" go install golang.org/x/lint/golint@latest
"${GOPATH}"/bin/golint -set_exit_status "${@}"
else
podman run --rm \
podman run --rm \
--env IS_CONTAINER=TRUE \
--volume "${PWD}:/go/src/github.com/openshift/installer:z" \
--workdir /go/src/github.com/openshift/installer \
docker.io/golang:1.18 \
./hack/go-lint.sh "${@}"
fi
docker.io/golangci/golangci-lint:v1.46.0 \
golangci-lint run "${@}"
2 changes: 0 additions & 2 deletions tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (
_ "github.com/daixiang0/gci" // dependency of hack/go-fmt.sh
// used to generate mocks
_ "github.com/golang/mock/mockgen"
// dependency of hack/go-lint.sh
_ "golang.org/x/lint"
// dependency of generating CRD for install-config
_ "sigs.k8s.io/controller-tools/cmd/controller-gen"
)
19 changes: 0 additions & 19 deletions vendor/golang.org/x/lint/.travis.yml

This file was deleted.

15 changes: 0 additions & 15 deletions vendor/golang.org/x/lint/CONTRIBUTING.md

This file was deleted.

27 changes: 0 additions & 27 deletions vendor/golang.org/x/lint/LICENSE

This file was deleted.

93 changes: 0 additions & 93 deletions vendor/golang.org/x/lint/README.md

This file was deleted.

Loading