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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -o manager main.go
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
# FROM gcr.io/distroless/static:nonroot
FROM docker-na-public.artifactory.swg-devops.com/hyc-cloud-private-edge-docker-local/build-images/ubi8-minimal:latest
FROM docker-na-public.artifactory.swg-devops.com/hyc-cloud-private-edge-docker-local/build-images/ubi9-minimal:latest

ARG VCS_REF
ARG VCS_URL
Expand Down
1 change: 1 addition & 0 deletions common/Makefile.common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ lint-copyright-banner:
${XARGS} common/scripts/lint_copyright_banner.sh

lint-go:
golangci-lint version
@${FINDFILES} -name '*.go' \( ! \( -name '*.gen.go' -o -name '*.pb.go' \) \) -print0 | ${XARGS} common/scripts/lint_go.sh

lint-all: lint-copyright-banner lint-go
Expand Down
42 changes: 30 additions & 12 deletions common/config/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
service:
# When updating this, also update the version stored in docker/build-tools/Dockerfile in the multicloudlab/tools repo.
golangci-lint-version: 1.51.x # use the fixed version to not introduce new linters unexpectedly
golangci-lint-version: 1.60.x # use the fixed version to not introduce new linters unexpectedly
run:
# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 20m
Expand All @@ -10,43 +10,44 @@ run:
# default value is empty list, but next dirs are always skipped independently
# from this option's value:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs:
- genfiles$
- vendor$
# skip-dirs:
# - genfiles$
# - vendor$

# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
skip-files:
- ".*\\.pb\\.go"
- ".*\\.gen\\.go"
# skip-files:
# - ".*\\.pb\\.go"
# - ".*\\.gen\\.go"

linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- deadcode
# - deadcode
- errcheck
# - gocyclo
- gofmt
- goimports
- golint
# - golint
- revive
# - gosec
- gosimple
- govet
# - ineffassign
- interfacer
# - interfacer
- lll
# - misspell
- staticcheck
- structcheck
# - structcheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
# - varcheck
# don't enable:
# - gocritic
# - bodyclose
Expand Down Expand Up @@ -184,6 +185,15 @@ linters-settings:
# - unlabelStmt
# - unnamedResult
# - wrapperFunc

revive:
rules:
- name: dot-imports
arguments:
- allowedPackages:
- "github.com/onsi/ginkgo"
- "github.com/onsi/ginkgo/v2"
- "github.com/onsi/gomega"

issues:
# List of regexps of issue texts to exclude, empty list by default.
Expand All @@ -193,6 +203,14 @@ issues:
exclude:
- composite literal uses unkeyed fields

exclude-dirs:
- genfiles$
- vendor$

exclude-files:
- ".*\\.pb\\.go"
- ".*\\.gen\\.go"

exclude-rules:
# Exclude some linters from running on test files.
- path: _test\.go$|^tests/|^samples/
Expand Down
2 changes: 1 addition & 1 deletion common/scripts/lint_go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# limitations under the License.
#

GOGC=25 golangci-lint run -c ./common/config/.golangci.yml
GOGC=25 golangci-lint run -c ./common/config/.golangci.yml --timeout=180s
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/IBM/ibm-common-service-operator

go 1.21
go 1.23

toolchain go1.21.3
toolchain go1.23.0

require (
github.com/IBM/controller-filtered-cache v0.3.5
Expand Down