mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-01-13 13:21:00 +00:00
chore: update golangci-lint to v2 and fix breakage (#184)
deps: update golangci/golangci-lint-action action to v8 Co-authored-by: Julian Tölle <julian.toelle97@gmail.com>
This commit is contained in:
parent
49855aa700
commit
e3ecd8993c
5 changed files with 53 additions and 21 deletions
4
.github/workflows/ci.yaml
vendored
4
.github/workflows/ci.yaml
vendored
|
|
@ -18,9 +18,9 @@ jobs:
|
|||
go-version-file: go.mod
|
||||
|
||||
- name: Run golangci-lint
|
||||
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6
|
||||
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8
|
||||
with:
|
||||
version: v1.64.8 # renovate: datasource=github-releases depName=golangci/golangci-lint
|
||||
version: v2.1.6 # renovate: datasource=github-releases depName=golangci/golangci-lint
|
||||
args: --timeout 5m
|
||||
|
||||
test:
|
||||
|
|
|
|||
|
|
@ -1,14 +1,38 @@
|
|||
version: "2"
|
||||
linters:
|
||||
presets:
|
||||
- bugs
|
||||
- error
|
||||
- import
|
||||
- metalinter
|
||||
- module
|
||||
- unused
|
||||
|
||||
enable:
|
||||
- asasalint
|
||||
- asciicheck
|
||||
- bidichk
|
||||
- bodyclose
|
||||
- contextcheck
|
||||
- durationcheck
|
||||
- errchkjson
|
||||
- errorlint
|
||||
- exhaustive
|
||||
- gocheckcompilerdirectives
|
||||
- gochecksumtype
|
||||
- gocritic
|
||||
- gomoddirectives
|
||||
- gomodguard
|
||||
- gosec
|
||||
- gosmopolitan
|
||||
- loggercheck
|
||||
- makezero
|
||||
- musttag
|
||||
- nilerr
|
||||
- nilnesserr
|
||||
- noctx
|
||||
- protogetter
|
||||
- reassign
|
||||
- recvcheck
|
||||
- rowserrcheck
|
||||
- spancheck
|
||||
- sqlclosecheck
|
||||
- testifylint
|
||||
- unparam
|
||||
- zerologlint
|
||||
- revive
|
||||
|
||||
disable:
|
||||
# preset error
|
||||
|
|
@ -18,10 +42,19 @@ linters:
|
|||
# preset import
|
||||
- depguard
|
||||
|
||||
linters-settings:
|
||||
gci:
|
||||
sections:
|
||||
- standard
|
||||
- default
|
||||
- localmodule
|
||||
settings:
|
||||
revive:
|
||||
rules:
|
||||
- name: exported
|
||||
disabled: true
|
||||
|
||||
formatters:
|
||||
enable:
|
||||
- gci
|
||||
- goimports
|
||||
settings:
|
||||
gci:
|
||||
sections:
|
||||
- standard
|
||||
- default
|
||||
- localmodule
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ func (r *Repository) UpdateFile(_ context.Context, path string, create bool, upd
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer file.Close()
|
||||
defer file.Close() //nolint:errcheck
|
||||
|
||||
content, err := io.ReadAll(file)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ func (pr *ReleasePullRequest) parseVersioningFlags(overrides ReleaseOverrides) R
|
|||
overrides.NextVersionType = versioning.NextVersionTypeAlpha
|
||||
case LabelReleasePending, LabelReleaseTagged:
|
||||
// These labels have no effect on the versioning.
|
||||
break
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package releasepr
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
|
@ -59,7 +58,7 @@ func TestReleasePullRequest_GetOverrides(t *testing.T) {
|
|||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got, err := tt.pr.GetOverrides()
|
||||
if !tt.wantErr(t, err, fmt.Sprintf("GetOverrides()")) {
|
||||
if !tt.wantErr(t, err, "GetOverrides()") {
|
||||
return
|
||||
}
|
||||
assert.Equalf(t, tt.want, got, "GetOverrides()")
|
||||
|
|
@ -115,7 +114,7 @@ Suffix Things
|
|||
},
|
||||
}
|
||||
got, err := pr.ChangelogText()
|
||||
if !tt.wantErr(t, err, fmt.Sprintf("ChangelogText()")) {
|
||||
if !tt.wantErr(t, err, "ChangelogText()") {
|
||||
return
|
||||
}
|
||||
assert.Equalf(t, tt.want, got, "ChangelogText()")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue