Skip to content

Commit 34a1694

Browse files
authored
fix(go): upgrade the linter (#3140)
1 parent cc09700 commit 34a1694

File tree

6 files changed

+18
-28
lines changed

6 files changed

+18
-28
lines changed

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ runs:
128128
if: ${{ inputs.language == 'go' }}
129129
shell: bash
130130
run: |
131-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
131+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.59.0
132132
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
133133
go install golang.org/x/tools/cmd/goimports@latest
134134

clients/algoliasearch-client-go/.golangci.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
linters-settings:
22
govet:
3-
check-shadowing: true
43
enable-all: true
54
disable:
65
- fieldalignment
76

87
revive:
9-
min-confidence: 0.8
108
rules:
119
- name: var-naming
1210
disabled: true
@@ -54,20 +52,17 @@ linters:
5452
- wastedassign
5553
- gocyclo
5654
- maintidx
55+
- copyloopvar
56+
- intrange
57+
- canonicalheader
58+
- mnd
59+
- perfsprint
5760

5861
# Deprecated
59-
- deadcode
60-
- exhaustivestruct
61-
- golint
62-
- ifshort
63-
- interfacer
64-
- maligned
65-
- nosnakecase
66-
- scopelint
67-
- structcheck
68-
- varcheck
69-
service:
70-
golangci-lint-version: 1.55.2
62+
- execinquery
63+
64+
issues:
65+
exclude-generated: disable
7166

7267
run:
7368
concurrency: 2

generators/src/main/java/com/algolia/codegen/AlgoliaGoGenerator.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,7 @@ public void processOpts() {
3636
super.processOpts();
3737

3838
// Generation notice, added on every generated files
39-
// The banner is custom for go because golangci-lint will not format generated files, and we
40-
// can't disable it
41-
// https://github.com/golangci/golangci-lint/blob/f921f000f8494e32d2d5d38939c999414bb6b7e1/pkg/result/processors/autogenerated_exclude.go#L77
42-
additionalProperties.put(
43-
"generationBanner",
44-
"File generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will" +
45-
" be lost - read more on https://github.com/algolia/api-clients-automation."
46-
);
39+
Helpers.setGenerationBanner(additionalProperties);
4740

4841
apiTestTemplateFiles.clear();
4942
modelTestTemplateFiles.clear();

scripts/docker/Dockerfile.base

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ RUN echo "export PATH=$PATH:/usr/local/bin/python" >> ~/.profile \
4747
# Go
4848
COPY --from=go-builder /usr/local/go/ /usr/local/go/
4949
RUN echo "export PATH=$PATH:/usr/local/go/bin:/root/go/bin" >> ~/.profile && source ~/.profile \
50-
&& curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2 \
50+
&& curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.59.0 \
5151
&& go install golang.org/x/tools/cmd/goimports@latest
5252

5353

snippets/go/.golangci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ linters:
22
disable:
33
- ineffassign
44
- staticcheck
5-
service:
6-
golangci-lint-version: 1.55.2
5+
6+
issues:
7+
exclude-generated: disable
78

89
run:
910
concurrency: 2

tests/output/go/.golangci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ linters:
22
disable:
33
- ineffassign
44
- staticcheck
5-
service:
6-
golangci-lint-version: 1.55.2
5+
6+
issues:
7+
exclude-generated: disable
78

89
run:
910
concurrency: 2

0 commit comments

Comments
 (0)