Skip to content

Commit

Permalink
consume golangci-linter 1.61.0 and update build submodule
Browse files Browse the repository at this point in the history
Signed-off-by: Fatih Türken <[email protected]>
  • Loading branch information
turkenf committed Jan 6, 2025
1 parent 6838809 commit e199681
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
workflow_dispatch: {}

env:
GO_VERSION: "1.21"
GO_VERSION: "1.23"

jobs:
detect-noop:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/uptest-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
types: [created]

env:
GO_VERSION: "1.21"
GO_VERSION: "1.23"

jobs:
debug:
Expand Down
20 changes: 11 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
# SPDX-License-Identifier: CC0-1.0

run:
deadline: 10m

skip-files:
- "zz_\\..+\\.go$"
timeout: 10m

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

linters-settings:
errcheck:
Expand All @@ -25,7 +23,8 @@ 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-files:
- fmt:.*,io/ioutil:^Read.*

govet:
# report about shadowed variables
Expand Down Expand Up @@ -108,17 +107,18 @@ linters-settings:

linters:
enable:
- megacheck
- govet
- gocyclo
- gocritic
- interfacer
- goconst
- goimports
- gofmt # We enable this as well as goimports for its simplify mode.
- gosimple
- prealloc
- revive
- staticcheck
- unconvert
- unused
- misspell
- nakedret

Expand All @@ -129,6 +129,8 @@ linters:


issues:
exclude-files:
- "zz_\\..+\\.go$"
# Excluding configuration per-path and per-linter
exclude-rules:
# Exclude some linters from running on tests files.
Expand All @@ -140,7 +142,7 @@ issues:
- gosec
- scopelint
- unparam

# Ease some gocritic warnings on test files.
- path: _test\.go
text: "(unnamedResult|exitAfterDefer)"
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,13 @@ go.cachedir:
go.mod.cachedir:
@go env GOMODCACHE

go.lint.analysiskey-interval:
@# cache is invalidated at least every 7 days
@echo -n golangci-lint.cache-$$(( $$(date +%s) / (7 * 86400) ))-

go.lint.analysiskey:
@echo $$(make go.lint.analysiskey-interval)$$(sha1sum go.sum | cut -d' ' -f1)

DEP_CONSTRAINT ?= >= 0.0.0
ifeq (-,$(findstring -,$(VERSION)))
DEP_CONSTRAINT = >= 0.0.0-0
Expand Down Expand Up @@ -368,7 +375,7 @@ load-pkg: $(UP) build.all

@$(OK) Loaded the family providers into the Docker daemon: $(SUBPACKAGES)

.PHONY: cobertura reviewable submodules fallthrough go.mod.cachedir go.cachedir run crds.clean $(TERRAFORM_PROVIDER_SCHEMA) load-pkg
.PHONY: cobertura reviewable submodules fallthrough go.mod.cachedir go.cachedir go.lint.analysiskey-interval go.lint.analysiskey run crds.clean $(TERRAFORM_PROVIDER_SCHEMA) load-pkg

build.init: kustomize-crds

Expand Down
2 changes: 1 addition & 1 deletion build
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/upbound/provider-gcp-beta

go 1.21
go 1.23

require (
dario.cat/mergo v1.0.0
Expand Down

0 comments on commit e199681

Please sign in to comment.