Skip to content

Commit 6183580

Browse files
authored
chore: golangci-lint update (#813)
1 parent 448730f commit 6183580

File tree

5 files changed

+41
-15
lines changed

5 files changed

+41
-15
lines changed

.github/workflows/pr.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
11
on: pull_request
22
name: pull_request
3+
4+
concurrency:
5+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
6+
cancel-in-progress: true
7+
8+
permissions:
9+
contents: read
10+
11+
env:
12+
GO_VERSION: 1.25.x # NB! when updating also update matrix, we cannot refer to env variables in the matrix
13+
GOLANGCI_LINT_VERSION: v2.10.1
14+
315
jobs:
416
staticcheck:
517
runs-on: ubuntu-latest
618
steps:
719
- name: checkout code
8-
uses: actions/checkout@v6.0.2
20+
uses: actions/checkout@v6.0.2 # nonpinned - official GH action
921
with:
1022
fetch-depth: 0
1123
- name: install Go
12-
uses: actions/setup-go@v6.2.0
24+
uses: actions/setup-go@v6.2.0 # nonpinned - official GH action
1325
with:
14-
go-version: 1.25.x
26+
go-version: ${{ env.GO_VERSION }}
1527

1628
- name: gofmt
1729
run: if [[ -n $(gofmt -l .) ]]; then echo "please run gofmt"; exit 1; fi
@@ -25,9 +37,9 @@ jobs:
2537
if [[ -n $(git status --porcelain) ]]; then echo "git repo is dirty after running go generate -- please don't modify generated files"; echo $(git diff);echo $(git status --porcelain); exit 1; fi
2638
2739
- name: golangci-lint
28-
uses: golangci/golangci-lint-action@v9.2.0
40+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 #v9.2.0 pinned
2941
with:
30-
version: v2.8.0
42+
version: ${{ env.GOLANGCI_LINT_VERSION }}
3143
args: -v --timeout=5m
3244

3345
test:
@@ -41,15 +53,15 @@ jobs:
4153
- name: install Go
4254
uses: actions/setup-go@v6.2.0
4355
with:
44-
go-version: 1.25.x
56+
go-version: ${{ env.GO_VERSION }}
4557

4658
- name: install deps
4759
run: |
4860
go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest
4961
5062
# Install gotestfmt on the VM running the action.
5163
- name: Set up gotestfmt
52-
uses: gotesttools/gotestfmt-action@v2.2.0
64+
uses: gotesttools/gotestfmt-action@8b4478c7019be847373babde9300210e7de34bfb #v2.2.0 pinned
5365
with:
5466
# Optional: pass GITHUB_TOKEN to avoid rate limiting.
5567
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/push.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ on:
33
branches:
44
- "master"
55
name: push_master
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: read
13+
14+
env:
15+
GO_VERSION: 1.25.x # NB! when updating also update matrix, we cannot refer to env variables in the matrix
16+
GOLANGCI_LINT_VERSION: v2.10.1
17+
618
jobs:
719
staticcheck:
820
runs-on: ubuntu-latest
@@ -14,7 +26,7 @@ jobs:
1426
- name: install Go
1527
uses: actions/setup-go@v6.2.0
1628
with:
17-
go-version: 1.25.x
29+
go-version: ${{ env.GO_VERSION }}
1830

1931
- name: gofmt
2032
run: if [[ -n $(gofmt -l .) ]]; then echo "please run gofmt"; exit 1; fi
@@ -28,9 +40,9 @@ jobs:
2840
if [[ -n $(git status --porcelain) ]]; then echo "git repo is dirty after running go generate -- please don't modify generated files"; echo $(git diff);echo $(git status --porcelain); exit 1; fi
2941
3042
- name: golangci-lint
31-
uses: golangci/golangci-lint-action@v9.2.0
43+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 #v9.2.0 pinned
3244
with:
33-
version: v2.8.0
45+
version: ${{ env.GOLANGCI_LINT_VERSION }}
3446
args: -v --timeout=5m
3547

3648
test:
@@ -50,15 +62,15 @@ jobs:
5062
failures: ${{ steps.generate-job-summary.outputs.failures }}
5163
steps:
5264
- name: checkout code
53-
uses: actions/checkout@v6.0.2
65+
uses: actions/checkout@v6.0.2 # nonpinned - official GH action
5466
- name: install Go
55-
uses: actions/setup-go@v6.2.0
67+
uses: actions/setup-go@v6.2.0 # nonpinned - official GH action
5668
with:
5769
go-version: ${{ matrix.go-version }}
5870

5971
# Install gotestfmt on the VM running the action.
6072
- name: Set up gotestfmt
61-
uses: gotesttools/gotestfmt-action@v2.2.0
73+
uses: gotesttools/gotestfmt-action@8b4478c7019be847373babde9300210e7de34bfb #v2.2.0 pinned
6274
with:
6375
# Optional: pass GITHUB_TOKEN to avoid rate limiting.
6476
token: ${{ secrets.GITHUB_TOKEN }}

ecc/secp256r1/g1_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ func TestG1CrossImplementations(t *testing.T) {
423423
Gx, Gy := curve.Params().Gx, curve.Params().Gy
424424
var S big.Int
425425
s.BigInt(&S)
426-
Qx, Qy := curve.ScalarMult(Gx, Gy, S.Bytes())
426+
Qx, Qy := curve.ScalarMult(Gx, Gy, S.Bytes()) //nolint:staticcheck // compatibility test only
427427
var Q G1Affine
428428
Q.ScalarMultiplication(&g1GenAff, &S)
429429
var qx, qy fp.Element

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/consensys/gnark-crypto
22

3-
go 1.25.6
3+
go 1.25.7
44

55
require (
66
github.com/bits-and-blooms/bitset v1.24.4

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
122122
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
123123
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
124124
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
125+
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
126+
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
125127
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
126128
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
127129
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=

0 commit comments

Comments
 (0)