Skip to content

Commit b96389d

Browse files
authored
update to go1.25, node24, golangci-lint v2, trixie (#483)
Considered pinning `gopls` again, but we want to be relatively up-to-date so figured I'd update things. I'm sure there's a better way to manage the node version, but this gets updated less than yearly so I'm not worried about it. Made a few tweaks to satisfy golangci-lint but nothing significant. fixes #482
1 parent e5f70fb commit b96389d

File tree

13 files changed

+27
-20
lines changed

13 files changed

+27
-20
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"build": {
55
"dockerfile": "../tools/devtools/Dockerfile",
66
"args": {
7-
"BASE_IMG": "mcr.microsoft.com/devcontainers/typescript-node:18-bullseye"
7+
"BASE_IMG": "mcr.microsoft.com/devcontainers/typescript-node:24-trixie"
88
}
99
},
1010
"postCreateCommand": "sudo find . -name node_modules -exec chown node:node {} \\;",

.github/workflows/examples-autocomplete.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: builds the autocomplete example usage of reference-lib
22
on:
33
push:
44
branches: ['main']
5-
paths: ['examples/autocomplete/**', 'reference-lib/**']
5+
paths: ['examples/autocomplete/**', '.github/workflows/examples-autocomplete.yml', 'reference-lib/**']
66
pull_request:
77
branches: ['main']
8-
paths: ['examples/autocomplete/**', 'reference-lib/**']
8+
paths: ['examples/autocomplete/**', '.github/workflows/examples-autocomplete.yml', 'reference-lib/**']
99

1010
defaults:
1111
run:
@@ -18,6 +18,8 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v5
2020
- uses: actions/setup-node@v6
21+
with:
22+
node-version: 24
2123
- name: build the reference-lib
2224
working-directory: ./reference-lib
2325
run: |

.github/workflows/examples-ref-browser.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: builds the example ref-browser usage of reference-lib
22
on:
33
push:
44
branches: ['main']
5-
paths: ['examples/ref-browser/**', 'reference-lib/**']
5+
paths: ['examples/ref-browser/**', '.github/workflows/examples-ref-browser.yml', 'reference-lib/**']
66
pull_request:
77
branches: ['main']
8-
paths: ['examples/ref-browser/**', 'reference-lib/**']
8+
paths: ['examples/ref-browser/**', '.github/workflows/examples-ref-browser.yml', 'reference-lib/**']
99

1010
defaults:
1111
run:
@@ -18,6 +18,8 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v5
2020
- uses: actions/setup-node@v6
21+
with:
22+
node-version: 24
2123
- name: build the reference-lib
2224
working-directory: ./reference-lib
2325
run: |

.github/workflows/reference-converter.daily.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
fi
3333
3434
- uses: actions/setup-node@v6
35+
with:
36+
node-version: 24
3537
- name: update npm package version
3638
if: steps.diff.outputs.reference_change
3739
run: npm version patch --no-git-tag-version

.github/workflows/reference-converter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
cache: false
5252
- name: use the same version of GOLANGCI_LINT_VERSION as devtools
5353
run: make devtools-versions >> "$GITHUB_ENV"
54-
- uses: golangci/golangci-lint-action@v6
54+
- uses: golangci/golangci-lint-action@v9
5555
with:
5656
working-directory: ${{ env.working-directory }}
5757
version: v${{ env.GOLANGCI_LINT_VERSION }}

.github/workflows/reference-lib.publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
- uses: actions/checkout@v5
2020
- uses: actions/setup-node@v6
2121
with:
22-
node-version: '16.x'
2322
registry-url: 'https://registry.npmjs.org'
23+
node-version: 24
2424
- name: Install dependencies
2525
run: npm ci
2626
- name: Test it out

.golangci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
version: "2"
12
linters:
2-
# add non-default linters https://golangci-lint.run/usage/linters/#disabled-by-default
3+
# add non-default linters https://golangci-lint.run/docs/linters/
34
enable:
45
- bodyclose
56
- errorlint

reference-converter/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/nginxinc/nginx-directive-reference/reference-converter
22

3-
go 1.24
3+
go 1.25
44

55
require (
66
github.com/gomarkdown/markdown v0.0.0-20241205020045-f7e15b2f3e62

reference-converter/internal/atom/atom.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func openURL(ctx context.Context, url string, client http.Client) ([]byte, error
4747
if err != nil {
4848
return nil, fmt.Errorf("unable to download %s: %w", url, err)
4949
}
50-
defer res.Body.Close()
50+
defer res.Body.Close() //nolint:errcheck // nothing to do about it
5151

5252
if res.StatusCode != http.StatusOK {
5353
return nil, fmt.Errorf("unable to download %s: %s", url, res.Status)

reference-converter/internal/parse/link.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func (l *link) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
3535
title = p.Name
3636
}
3737

38-
title = strings.Replace(title, "\n", " ", -1)
38+
title = strings.ReplaceAll(title, "\n", " ")
3939

4040
href := attrs["url"]
4141
if href == "" {

0 commit comments

Comments
 (0)