Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: update reviewdog warning linter job #6175

Merged
merged 6 commits into from
Nov 21, 2024
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
10 changes: 6 additions & 4 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: "ReviewDog workflow"
env:
GOLANGCI_LINT_VERSION: "v1.62.0"
on:
push:
branches:
Expand All @@ -20,7 +22,7 @@ jobs:
uses: reviewdog/[email protected]
with:
go_version_file: go.mod
golangci_lint_version: "v1.62.0"
golangci_lint_version: ${{ env.GOLANGCI_LINT_VERSION }}
golangci_lint_flags: "-c .golangci.yml --allow-parallel-runners"
reporter: "github-pr-check"
tool_name: "Lint Errors"
Expand Down Expand Up @@ -56,14 +58,14 @@ jobs:
uses: actions/[email protected]
with:
path: cicdtmp/golangci-lint/golangci-lint-cgo
key: cicd-golangci-lint-cgo-v0.0.2-${{ env.GO_VERSION }}
key: cicd-golangci-lint-cgo-v0.0.3-${{ env.GO_VERSION }}-${{ env.GOLANGCI_LINT_VERSION }}

- name: Build custom golangci-lint with CGO_ENABLED
if: steps.cache-golangci-lint.outputs.cache-hit != 'true'
run: |
cd cicdtmp/golangci-lint
git clone https://github.com/golangci/golangci-lint.git .
git checkout tags/v1.62.0
git checkout tags/${GOLANGCI_LINT_VERSION}
CGO_ENABLED=true go build -trimpath -o golangci-lint-cgo ./cmd/golangci-lint
./golangci-lint-cgo --version
cd ../../
Expand Down Expand Up @@ -92,7 +94,7 @@ jobs:
cat temp_golangci-lint-cgo.txt | reviewdog \
-f=golangci-lint \
-name="Lint Warnings" \
-reporter=github-check \
-reporter=github-pr-check \
-filter-mode=added \
-fail-on-error=true \
-level=warning
Expand Down
4 changes: 2 additions & 2 deletions .golangci-warnings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ linters:
- partitiontest

linters-settings:
gosec: # we are mostly only interested in G601
excludes: [G101, G103, G104, G107, G202, G301, G302, G303, G304, G306, G307, G404]
gosec: # Go 1.22 makes G601 irrelevant
excludes: [G101, G103, G104, G107, G115, G202, G301, G302, G303, G304, G306, G307, G404, G601]
gmalouf marked this conversation as resolved.
Show resolved Hide resolved
custom:
partitiontest:
path: cmd/partitiontest_linter/plugin.so
Expand Down
2 changes: 1 addition & 1 deletion data/transactions/logic/assembler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2269,7 +2269,7 @@ func define(ops *OpStream, tokens []token) *sourceError {
} else {
delete(ops.macros, name) // remove new macro that caused cycle
}
return tokens[1].errorf("macro expansion cycle discovered: %s", strings.Join(found, " -> "))
return tokens[1].errorf("macro expansion cycle discovered: %s", strings.Join(found, " -> ")) //nolint:gosec // false positive, len(tokens) >= 3
}
return nil
}
Expand Down
Loading