Skip to content

Commit

Permalink
Merge pull request #31 from kaessert/bump_versions
Browse files Browse the repository at this point in the history
Bump golang and golangci-lint version, fix warnings
  • Loading branch information
sergenyalcin authored Oct 8, 2024
2 parents a8fc648 + 6e77fce commit ca0a50d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ on:

env:
# Common versions
GO_VERSION: '1.21'
GOLANGCI_VERSION: 'v1.54.2'
GO_VERSION: '1.23'
GOLANGCI_VERSION: 'v1.61.0'
DOCKER_BUILDX_VERSION: 'v0.8.2'

# Common users. We can't run a step 'if secrets.XXX != ""' but we can run a
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/promote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

env:
# Common versions
GO_VERSION: '1.21'
GO_VERSION: '1.23'

# Common users. We can't run a step 'if secrets.XXX != ""' but we can run
# a step 'if env.XXX' != ""', so we copy these to succinctly test whether
Expand Down
18 changes: 10 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
run:
deadline: 10m

skip-files:
- "zz_\\..+\\.go$"

output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: colored-line-number
formats: colored-line-number

linters-settings:
errcheck:
Expand All @@ -25,7 +22,7 @@ linters-settings:
# [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.*
exclude-functions: fmt:.*,io/ioutil:^Read.*

govet:
# report about shadowed variables
Expand Down Expand Up @@ -108,11 +105,12 @@ linters-settings:

linters:
enable:
- megacheck
- gosimple
- staticcheck
- unused
- govet
- gocyclo
- gocritic
- interfacer
- goconst
- goimports
- gofmt # We enable this as well as goimports for its simplify mode.
Expand All @@ -130,6 +128,10 @@ linters:


issues:
# Excluding files
exclude-files:
- "zz_\\..+\\.go$"

# Excluding configuration per-path and per-linter
exclude-rules:
# Exclude some linters from running on tests files.
Expand All @@ -141,7 +143,7 @@ issues:
- gosec
- scopelint
- unparam

# Ease some gocritic warnings on test files.
- path: _test\.go
text: "(unnamedResult|exitAfterDefer)"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ S3_BUCKET ?= crossplane.uptest.releases
GO_REQUIRED_VERSION = 1.21
# GOLANGCILINT_VERSION is inherited from build submodule by default.
# Uncomment below if you need to override the version.
# GOLANGCILINT_VERSION ?= 1.54.0
GOLANGCILINT_VERSION ?= 1.61.0

GO_STATIC_PACKAGES = $(GO_PROJECT)/cmd/uptest
GO_LDFLAGS += -X $(GO_PROJECT)/internal/version.Version=$(VERSION)
Expand Down
2 changes: 1 addition & 1 deletion internal/prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (p *preparer) prepareManifests() ([]config.Manifest, error) {
if err := os.RemoveAll(caseDirectory); err != nil {
return nil, errors.Wrapf(err, "cannot clean directory %s", caseDirectory)
}
if err := os.MkdirAll(caseDirectory, os.ModePerm); err != nil {
if err := os.MkdirAll(caseDirectory, os.ModePerm); err != nil { //nolint:gosec // directory permissions are not critical here
return nil, errors.Wrapf(err, "cannot create directory %s", caseDirectory)
}

Expand Down

0 comments on commit ca0a50d

Please sign in to comment.