chore(ci/deps): upgrade CI dependencies and fix linting issues (#136)

This commit is contained in:
2025-06-27 11:25:16 +01:00
committed by GitHub
parent 3cf1977def
commit 28ff28b29a
6 changed files with 85 additions and 70 deletions

View File

@@ -1,5 +1,6 @@
{ {
"bootstrap-sha": "3d6c7fff64bda8ba0dbea181c9f94fb9716dd188", "bootstrap-sha": "3d6c7fff64bda8ba0dbea181c9f94fb9716dd188",
"always-update": true,
"packages": { "packages": {
".": { ".": {
"release-type": "simple", "release-type": "simple",

View File

@@ -10,11 +10,11 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: "1.23" go-version-file: go.mod
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v8
with: with:
version: v1.61 version: v2.1
env: env:
VERBOSE: "true" VERBOSE: "true"
@@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: "1.23" go-version-file: go.mod
- name: Check if mods are tidy - name: Check if mods are tidy
run: make check-tidy run: make check-tidy
@@ -36,14 +36,18 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: "1.23" go-version-file: go.mod
- name: Run tests - name: Run tests
run: make test run: make test
env: env:
VERBOSE: "true" VERBOSE: "true"
release-please: release-please:
name: Release Please
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.ref_name == 'main' || github.ref_name == 'master' if: ${{ github.ref_name == 'main' || github.ref_name == 'master' }}
permissions:
contents: read
pull-requests: write
steps: steps:
- uses: jimeh/release-please-manifest-action@v1 - uses: jimeh/release-please-manifest-action@v2

View File

@@ -1,25 +1,9 @@
linters-settings: version: "2"
funlen: run:
lines: 100 modules-download-mode: readonly
statements: 150 allow-parallel-runners: true
goconst:
min-occurrences: 5
gocyclo:
min-complexity: 20
govet:
enable-all: true
disable:
- fieldalignment
lll:
line-length: 80
tab-width: 4
maligned:
suggest-new: true
misspell:
locale: US
linters: linters:
disable-all: true default: none
enable: enable:
- bodyclose - bodyclose
- copyloopvar - copyloopvar
@@ -30,12 +14,8 @@ linters:
- goconst - goconst
- gocritic - gocritic
- gocyclo - gocyclo
- gofumpt
- goimports
- goprintffuncname
- goprintffuncname - goprintffuncname
- gosec - gosec
- gosimple
- govet - govet
- ineffassign - ineffassign
- lll - lll
@@ -47,36 +27,69 @@ linters:
- revive - revive
- sqlclosecheck - sqlclosecheck
- staticcheck - staticcheck
- typecheck
- unconvert - unconvert
- unused - unused
- whitespace - whitespace
settings:
issues: funlen:
exclude: lines: 100
- Using the variable on range scope `tt` in function literal statements: 150
- Using the variable on range scope `tc` in function literal goconst:
exclude-rules: min-occurrences: 5
- path: "_test\\.go" gocyclo:
linters: min-complexity: 20
- funlen govet:
disable:
- fieldalignment
enable-all: true
lll:
line-length: 80
tab-width: 4
misspell:
locale: US
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- dupl - dupl
- funlen
- goconst - goconst
- source: "^//go:generate " path: _test\.go
linters: - linters:
- lll - lll
- source: "`json:" source: "^//go:generate "
linters: - linters:
- lll - lll
- source: "`yaml:" source: "`json:"
linters: - linters:
- lll - lll
exclude-dirs: source: "`yaml:"
- path: (.+)\.go$
text: Using the variable on range scope `tt` in function literal
- path: (.+)\.go$
text: Using the variable on range scope `tc` in function literal
paths:
- builds - builds
- sources - sources
- tarballs - tarballs
- third_party$
run: - builtin$
timeout: 2m - examples$
allow-parallel-runners: true formatters:
modules-download-mode: readonly enable:
- gofumpt
- goimports
exclusions:
generated: lax
paths:
- builds
- sources
- tarballs
- third_party$
- builtin$
- examples$

View File

@@ -71,7 +71,7 @@ $(TOOLDIR)/$(1): Makefile
endef endef
$(eval $(call tool,gofumpt,mvdan.cc/gofumpt@latest)) $(eval $(call tool,gofumpt,mvdan.cc/gofumpt@latest))
$(eval $(call tool,golangci-lint,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61)) $(eval $(call tool,golangci-lint,github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1))
$(eval $(call tool,gomod,github.com/Helcaraxan/gomod@latest)) $(eval $(call tool,gomod,github.com/Helcaraxan/gomod@latest))
.PHONY: tools .PHONY: tools

View File

@@ -287,7 +287,7 @@ func (s *Updater) createRepoFile(
s.logger.Info( s.logger.Info(
"new commit created", "new commit created",
"commit", contResp.GetSHA(), "message", contResp.GetMessage(), "commit", contResp.GetSHA(), "message", contResp.GetMessage(),
"url", contResp.Commit.GetHTMLURL(), "url", contResp.GetHTMLURL(),
) )
return nil return nil
@@ -354,7 +354,7 @@ func (s *Updater) updateRepoFile(
s.logger.Info( s.logger.Info(
"new commit created", "new commit created",
"commit", contResp.GetSHA(), "message", contResp.GetMessage(), "commit", contResp.GetSHA(), "message", contResp.GetMessage(),
"url", contResp.Commit.GetHTMLURL(), "url", contResp.GetHTMLURL(),
) )
return true, nil return true, nil

View File

@@ -65,10 +65,7 @@ func (s *OSInfo) distinctVersion(version string) string {
return parts[0] return parts[0]
} }
max := len(parts) end := min(len(parts), 2)
if max > 2 {
max = 2
}
return strings.Join(parts[0:max], ".") return strings.Join(parts[0:end], ".")
} }