Skip to content

Commit 1ecac6c

Browse files
authored
Update golangci to v2.7.2 (release-1.29) (#594)
1 parent 8347607 commit 1ecac6c

File tree

4 files changed

+32
-43
lines changed

4 files changed

+32
-43
lines changed

.github/workflows/gatekeeper.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Gatekeeper
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened]
5+
types: [assigned, opened, reopened, synchronize]
66
workflow_dispatch: # Allow manual triggering
77

88
jobs:

.github/workflows/go.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,8 @@ jobs:
3838
uses: actions/setup-go@v6
3939
with:
4040
go-version: ${{ steps.get-ver.outputs.go_version }}
41-
- name: Install golangci-lint v1
42-
if: startsWith(steps.get-ver.outputs.golangci_version, 'v1')
43-
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # SHA for v6.5.2
44-
with:
45-
args: --disable-all --timeout 5m # disable linting, initialize cache
46-
version: ${{ steps.get-ver.outputs.golangci_version }}
4741
- name: Install golangci-lint v2
48-
if: startsWith(steps.get-ver.outputs.golangci_version, 'v2')
49-
uses: golangci/golangci-lint-action@v8
42+
uses: golangci/golangci-lint-action@v9
5043
with:
5144
version: ${{ steps.get-ver.outputs.golangci_version }}
5245
- name: Run go fmt (via golangci-lint)

.golangci.yml

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,32 @@
1-
# ******************************************************************************
2-
# IBM Cloud Kubernetes Service, 5737-D43
3-
# (C) Copyright IBM Corp. 2022, 2025 All Rights Reserved.
4-
#
5-
# SPDX-License-Identifier: Apache2.0
6-
#
7-
# Licensed under the Apache License, Version 2.0 (the "License");
8-
# you may not use this file except in compliance with the License.
9-
# You may obtain a copy of the License at
10-
#
11-
# http://www.apache.org/licenses/LICENSE-2.0
12-
#
13-
# Unless required by applicable law or agreed to in writing, software
14-
# distributed under the License is distributed on an "AS IS" BASIS,
15-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16-
# See the License for the specific language governing permissions and
17-
# limitations under the License.
18-
# ******************************************************************************
1+
version: "2"
192
linters:
20-
disable-all: true
213
enable:
22-
- gofmt
4+
- gocritic
235
- gosec
24-
- gosimple
25-
- staticcheck
26-
- unused
27-
- govet
6+
- govet # on by default
7+
- ineffassign # on by default
288
- misspell
29-
- ineffassign
30-
- gocritic
31-
32-
linters-settings: # please keep this alphabetized
33-
staticcheck:
34-
checks:
35-
- "all"
36-
- "-SA1006" # TODO(fix) Using a printf-style function with a dynamic format string and no arguments can just use a print-style func
9+
- staticcheck # on by default
10+
- unused # on by default
11+
disable:
12+
- errcheck
13+
- unconvert
14+
- unparam
15+
settings:
16+
staticcheck:
17+
checks:
18+
- all # Enable all checks by default
19+
- -ST1005 # error strings should not be capitalized / error strings should not end with punctuation or newlines
20+
- -ST1017 # don't use Yoda conditions
21+
- -ST1023 # should omit type string from declaration; it will be inferred from the right-hand side
22+
- -QF1008 # could remove embedded field "ObjectMeta" from selector
23+
- -QF1011 # could omit type string from declaration; it will be inferred from the right-hand side
24+
exclusions:
25+
presets:
26+
- comments
27+
- common-false-positives
28+
- legacy
29+
- std-error-handling
30+
formatters:
31+
enable:
32+
- gofmt

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export
2222
GOPACKAGES=$(shell go list ./...)
2323
SHFILES=$(shell find . -type f -name '*.sh')
2424

25-
GOLANGCI_LINT_VERSION := 1.64.8
25+
GOLANGCI_LINT_VERSION := 2.7.2
2626
GOLANGCI_LINT_EXISTS := $(shell golangci-lint --version 2>/dev/null)
2727

2828
TAG ?= v1.29.15
@@ -33,7 +33,7 @@ all: fmt lint lint-sh vet test ccm
3333
.PHONY: fmt
3434
fmt:
3535
ifdef GOLANGCI_LINT_EXISTS
36-
golangci-lint run --disable-all --no-config --enable=gofmt --timeout 5m
36+
golangci-lint fmt -v
3737
else
3838
@echo "golangci-lint is not installed"
3939
exit 1

0 commit comments

Comments
 (0)