Skip to content

Commit 0bc3d7e

Browse files
authored
CI: update reviewdog warning linter job (#6175)
1 parent db7f162 commit 0bc3d7e

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

.github/workflows/reviewdog.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: "ReviewDog workflow"
2+
env:
3+
GOLANGCI_LINT_VERSION: "v1.62.0"
24
on:
35
push:
46
branches:
@@ -20,7 +22,7 @@ jobs:
2022
uses: reviewdog/[email protected]
2123
with:
2224
go_version_file: go.mod
23-
golangci_lint_version: "v1.62.0"
25+
golangci_lint_version: ${{ env.GOLANGCI_LINT_VERSION }}
2426
golangci_lint_flags: "-c .golangci.yml --allow-parallel-runners"
2527
reporter: "github-pr-check"
2628
tool_name: "Lint Errors"
@@ -56,14 +58,14 @@ jobs:
5658
uses: actions/[email protected]
5759
with:
5860
path: cicdtmp/golangci-lint/golangci-lint-cgo
59-
key: cicd-golangci-lint-cgo-v0.0.2-${{ env.GO_VERSION }}
61+
key: cicd-golangci-lint-cgo-v0.0.3-${{ env.GO_VERSION }}-${{ env.GOLANGCI_LINT_VERSION }}
6062

6163
- name: Build custom golangci-lint with CGO_ENABLED
6264
if: steps.cache-golangci-lint.outputs.cache-hit != 'true'
6365
run: |
6466
cd cicdtmp/golangci-lint
6567
git clone https://github.com/golangci/golangci-lint.git .
66-
git checkout tags/v1.62.0
68+
git checkout tags/${GOLANGCI_LINT_VERSION}
6769
CGO_ENABLED=true go build -trimpath -o golangci-lint-cgo ./cmd/golangci-lint
6870
./golangci-lint-cgo --version
6971
cd ../../
@@ -92,7 +94,7 @@ jobs:
9294
cat temp_golangci-lint-cgo.txt | reviewdog \
9395
-f=golangci-lint \
9496
-name="Lint Warnings" \
95-
-reporter=github-check \
97+
-reporter=github-pr-check \
9698
-filter-mode=added \
9799
-fail-on-error=true \
98100
-level=warning

.golangci-warnings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ linters:
99
- partitiontest
1010

1111
linters-settings:
12-
gosec: # we are mostly only interested in G601
13-
excludes: [G101, G103, G104, G107, G202, G301, G302, G303, G304, G306, G307, G404]
12+
gosec: # Go 1.22 makes G601 irrelevant
13+
excludes: [G101, G103, G104, G107, G115, G202, G301, G302, G303, G304, G306, G307, G404, G601]
1414
custom:
1515
partitiontest:
1616
path: cmd/partitiontest_linter/plugin.so

data/transactions/logic/assembler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2269,7 +2269,7 @@ func define(ops *OpStream, tokens []token) *sourceError {
22692269
} else {
22702270
delete(ops.macros, name) // remove new macro that caused cycle
22712271
}
2272-
return tokens[1].errorf("macro expansion cycle discovered: %s", strings.Join(found, " -> "))
2272+
return tokens[1].errorf("macro expansion cycle discovered: %s", strings.Join(found, " -> ")) //nolint:gosec // false positive, len(tokens) >= 3
22732273
}
22742274
return nil
22752275
}

0 commit comments

Comments
 (0)