Skip to content

Commit bb1d9e4

Browse files
authored
chore: update dependencies (#38)
Update dependencies, workflows and Go version.
1 parent f9f1b15 commit bb1d9e4

File tree

12 files changed

+185
-153
lines changed

12 files changed

+185
-153
lines changed

.github/workflows/lint.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Checkout Repo 🛎
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@v5
2828
with:
2929
fetch-depth: 0
3030

3131
- name: Lint Code Base 🕵🏻‍♀️
32-
uses: super-linter/super-linter/slim@v7
32+
uses: super-linter/super-linter/slim@v8
3333
env:
3434
LINTER_RULES_PATH: /
3535
VALIDATE_ALL_CODEBASE: false
@@ -47,20 +47,20 @@ jobs:
4747
strategy:
4848
matrix:
4949
go-version:
50-
- 1.23.6
50+
- 1.24.7
5151
steps:
5252
- name: Checkout Repo 🛎
53-
uses: actions/checkout@v4
53+
uses: actions/checkout@v5
5454

5555
- name: Setup Go 🐹
56-
uses: actions/setup-go@v5
56+
uses: actions/setup-go@v6
5757
with:
5858
go-version: ${{ matrix.go-version }}
5959
cache: true
6060
cache-dependency-path: go.sum
6161

6262
- name: Lint Go Code 🕵🏻‍♂️
63-
uses: golangci/golangci-lint-action@v6
63+
uses: golangci/golangci-lint-action@v8
6464
with:
6565
version: latest
6666
only-new-issues: false

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ jobs:
2727
runs-on: ubuntu-latest
2828
steps:
2929
- name: Checkout Repo 🛎
30-
uses: actions/checkout@v4
30+
uses: actions/checkout@v5
3131
with:
3232
fetch-depth: 0
3333

3434
- name: Setup Go 🐹
35-
uses: actions/setup-go@v5
35+
uses: actions/setup-go@v6
3636
with:
37-
go-version: 1.23.6
37+
go-version: 1.24.7
3838
cache: true
3939
cache-dependency-path: go.sum
4040

.github/workflows/test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525
strategy:
2626
matrix:
2727
go-version:
28-
- 1.23.6
28+
- 1.24.7
2929
defaults:
3030
run:
3131
shell: bash
3232
steps:
3333
- name: Checkout Repo 🛎
34-
uses: actions/checkout@v4
34+
uses: actions/checkout@v5
3535

3636
- name: Setup Go 🐹
37-
uses: actions/setup-go@v5
37+
uses: actions/setup-go@v6
3838
with:
3939
go-version: ${{ matrix.go-version }}
4040
cache: true
@@ -92,14 +92,14 @@ jobs:
9292
strategy:
9393
matrix:
9494
go-version:
95-
- 1.23.6
95+
- 1.24.7
9696
runs-on: ubuntu-latest
9797
steps:
9898
- name: Checkout Repo 🛎
99-
uses: actions/checkout@v4
99+
uses: actions/checkout@v5
100100

101101
- name: Setup Go 🐹
102-
uses: actions/setup-go@v5
102+
uses: actions/setup-go@v6
103103
with:
104104
go-version: ${{ matrix.go-version }}
105105
cache: true

.golangci.yml

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,44 @@
1-
# See https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
2-
issues:
3-
exclude-rules:
4-
- path: _test\.go
5-
linters:
6-
- dupl
7-
- gosec
8-
- goconst
1+
version: "2"
92
linters:
103
enable:
11-
- gosec
12-
- unconvert
13-
- gocyclo
144
- goconst
15-
- goimports
165
- gocritic
17-
- govet
6+
- gocyclo
7+
- gosec
8+
- lll
189
- revive
19-
linters-settings:
20-
errcheck:
21-
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
22-
# default is false: such cases aren't reported by default.
23-
check-blank: true
24-
govet:
25-
enable:
26-
- shadow
27-
gocyclo:
28-
# minimal code complexity to report, 30 by default
29-
min-complexity: 15
10+
- unconvert
11+
settings:
12+
errcheck:
13+
check-blank: true
14+
gocyclo:
15+
min-complexity: 15
16+
lll:
17+
line-length: 120
18+
19+
exclusions:
20+
generated: lax
21+
presets:
22+
- comments
23+
- common-false-positives
24+
- legacy
25+
- std-error-handling
26+
rules:
27+
- linters:
28+
- dupl
29+
- goconst
30+
- gosec
31+
path: _test\.go
32+
paths:
33+
- third_party$
34+
- builtin$
35+
- examples$
36+
formatters:
37+
enable:
38+
- goimports
39+
exclusions:
40+
generated: lax
41+
paths:
42+
- third_party$
43+
- builtin$
44+
- examples$

.goreleaser.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Customization options: https://goreleaser.com/customization/
2+
version: 2
23
project_name: locksmith
34
before:
45
hooks:
@@ -39,3 +40,16 @@ dockers:
3940
- "--label=org.opencontainers.image.version={{ .Version }}"
4041
- "--build-arg=PROJECT_NAME={{ .ProjectName }}"
4142
- "--platform=linux/amd64"
43+
44+
# Update to this config in the future.
45+
# dockers_v2:
46+
# - images:
47+
# - "ghcr.io/insightsengineering/{{ .ProjectName }}"
48+
# tags:
49+
# - "latest"
50+
# - "{{ .Version }}"
51+
# labels:
52+
# "org.opencontainers.image.created": "{{ .Date }}"
53+
# "org.opencontainers.image.title": "{{ .ProjectName }}"
54+
# "org.opencontainers.image.revision": "{{ .FullCommit }}"
55+
# "org.opencontainers.image.version": "{{ .Version }}"

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
FROM scratch
22
ARG PROJECT_NAME="locksmith"
3+
# Uncomment when goreleaser config is updated to dockers_v2.
4+
# ARG TARGETPLATFORM
35
ENV PROJECT_NAME=${PROJECT_NAME}
46
COPY ${PROJECT_NAME} /
7+
# Change to this when goreleaser config is updated to dockers_v2.
8+
# COPY $TARGETPLATFORM/${PROJECT_NAME} /
59
WORKDIR /
610
# hadolint ignore=DL3025
711
ENTRYPOINT ${PROJECT_NAME}

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ help: ## Show this help menu
2525

2626
devdeps: ## Install development dependencies
2727
@printf "Executing target: [$@] 🎯\n"
28-
@which -a golangci-lint > /dev/null || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH) v1.55.2
28+
@which -a golangci-lint > /dev/null || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH) v2.5.0
2929
@which -a typex > /dev/null || go install github.com/dtgorski/typex@latest
30-
@which -a goreleaser > /dev/null || go install github.com/goreleaser/goreleaser@latest
30+
@# Goreleaser v2.12 requires Go 1.25, so pin to v2.11.2 for now
31+
@which -a goreleaser > /dev/null || go install github.com/goreleaser/goreleaser/v2@v2.11.2
3132
@which -a gocover-cobertura > /dev/null || go install github.com/boumenot/gocover-cobertura@latest
3233
@which -a misspell > /dev/null || go install github.com/client9/misspell/cmd/misspell@latest
3334
@which -a gotestdox > /dev/null || go install github.com/bitfield/gotestdox/cmd/gotestdox@latest

cmd/download.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ func GetGitHubSha(remoteUsername string, remoteRepo string, remoteRef string, to
134134
log.Trace("remoteRef = ", remoteRef, " doesn't match tag name regexp.")
135135
urlPath = "heads"
136136
}
137-
tagOrBranchURL := "https://api.github.com/repos/" + remoteUsername + "/" + remoteRepo + "/git/ref/" + urlPath + "/" + remoteRef
137+
tagOrBranchURL := "https://api.github.com/repos/" + remoteUsername + "/" + remoteRepo +
138+
"/git/ref/" + urlPath + "/" + remoteRef
138139
_, tagDataResponse, err := downloadFileFunction(tagOrBranchURL, token)
139140
if err == nil {
140141
var tagOrBranchData GitHubTagOrBranchResponse

cmd/renv.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,10 @@ func GetLatestPackageVersionFromAnyRepository(soughtPackageName string, packages
215215
for repositoryName, p := range packagesFiles {
216216
for _, packageDescription := range p.Packages {
217217
if packageDescription.Package == soughtPackageName {
218-
log.Trace(soughtPackageName, " version ", packageDescription.Version, " found in ", repositoryName, " repository.")
218+
log.Trace(
219+
soughtPackageName, " version ", packageDescription.Version, " found in ",
220+
repositoryName, " repository.",
221+
)
219222
if CheckIfVersionSufficient(packageDescription.Version, ">", latestPackageVersion) {
220223
latestPackageVersion = packageDescription.Version
221224
latestPackageVersionRepository = repositoryName
@@ -224,7 +227,10 @@ func GetLatestPackageVersionFromAnyRepository(soughtPackageName string, packages
224227
}
225228
}
226229
}
227-
log.Trace("Latest version ", latestPackageVersion, " for package ", soughtPackageName, " found in ", latestPackageVersionRepository, " repository.")
230+
log.Trace(
231+
"Latest version ", latestPackageVersion, " for package ", soughtPackageName, " found in ",
232+
latestPackageVersionRepository, " repository.",
233+
)
228234
return latestPackageVersionRepository
229235
}
230236

cmd/root.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ in an renv.lock-compatible file.`,
171171
inputPackages := ParseDescriptionFileList(inputDescriptionFiles)
172172
repositoryPackagesFiles := DownloadPackagesFiles(repositoryList, DownloadTextFile)
173173
packagesFiles := ParsePackagesFiles(repositoryPackagesFiles)
174-
outputPackageList := ConstructOutputPackageList(inputPackages, packagesFiles, repositoryList, allowedMissingDependencyTypes)
174+
outputPackageList := ConstructOutputPackageList(
175+
inputPackages, packagesFiles, repositoryList, allowedMissingDependencyTypes,
176+
)
175177
renvLock := GenerateRenvLock(outputPackageList, repositoryMap)
176178
GenerateHTMLReport(outputPackageList, inputPackages, packagesFiles, renvLock, repositoryMap)
177179
writeJSON(outputRenvLock, renvLock)

0 commit comments

Comments
 (0)