Skip to content

Commit 1b205a0

Browse files
authored
Merge pull request #8 from cybozu/regular-update
2 parents 787f369 + 6dcc749 commit 1b205a0

File tree

6 files changed

+38
-21
lines changed

6 files changed

+38
-21
lines changed

.github/workflows/lint_and_tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ on:
55
push:
66

77
env:
8-
go-version: 1.24
8+
go-version: 1.25
99

1010
jobs:
1111
unit-test:
1212
timeout-minutes: 20
1313
runs-on: ubuntu-24.04
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1616

17-
- uses: actions/setup-go@v5
17+
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
1818
with:
1919
go-version: ${{ env.go-version }}
2020

.golangci.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
1-
run:
2-
timeout: 3m
3-
1+
version: "2"
42
linters:
3+
exclusions:
4+
generated: lax
5+
presets:
6+
- comments
7+
- common-false-positives
8+
- legacy
9+
- std-error-handling
10+
paths:
11+
- third_party$
12+
- builtin$
13+
- examples$
14+
formatters:
515
enable:
616
- gofmt
17+
exclusions:
18+
generated: lax
19+
paths:
20+
- third_party$
21+
- builtin$
22+
- examples$

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
GIT := git
22
PRE_COMMIT := pre-commit
33

4-
JSONNET_VERSION := v0.20.0
5-
GOLANGCI_VERSION := v1.64.6
4+
JSONNET_VERSION := v0.21.0
5+
GOLANGCI_VERSION := v2.8.0
66

77
VERSION := v0.3.1
88

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module github.com/cybozu/pre-commit-jsonnet
22

3-
go 1.24
3+
go 1.25
44

5-
require golang.org/x/exp v0.0.0-20220428152302-39d4317da171
5+
require golang.org/x/exp v0.0.0-20260112195511-716be5621a96
66

7-
require github.com/sergi/go-diff v1.3.1
7+
require github.com/sergi/go-diff v1.4.0
88

9-
require golang.org/x/sys v0.31.0
9+
require golang.org/x/sys v0.40.0

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
66
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
77
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
88
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
9-
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
10-
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
9+
github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw=
10+
github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
1111
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
1212
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
1313
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
14-
golang.org/x/exp v0.0.0-20220428152302-39d4317da171 h1:TfdoLivD44QwvssI9Sv1xwa5DcL5XQr4au4sZ2F2NV4=
15-
golang.org/x/exp v0.0.0-20220428152302-39d4317da171/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE=
16-
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
17-
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
14+
golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU=
15+
golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU=
16+
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
17+
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
1818
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
1919
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
2020
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

hooks/jsonnet-fmt-hook/main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,12 @@ func summarizeDiff(diffs []diffmatchpatch.Diff) *FileDiff {
9999
endWithLineBreak = text[len(text)-1:] == "\n"
100100
writeLineCount := min(maxShowLine, len(lines))
101101

102-
if i == 0 {
102+
switch i {
103+
case 0:
103104
showTail = true
104-
} else if i == lastDiffIdx {
105+
case lastDiffIdx:
105106
showHead = true
106-
} else {
107+
default:
107108
showTail = true
108109
showHead = true
109110
}

0 commit comments

Comments
 (0)