Skip to content

Commit 1a74492

Browse files
authored
lint bump to v1.59.1 (#96)
1 parent 68c1012 commit 1a74492

File tree

10 files changed

+13
-13
lines changed

10 files changed

+13
-13
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
- name: golangci-lint
1515
uses: golangci/golangci-lint-action@v6
1616
with:
17-
version: v1.56.2
17+
version: v1.59.1
1818
- name: go mod tidy check
1919
uses: katexochen/go-tidy-check@v2

.golangci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ linters:
1515
- dupl
1616
- durationcheck
1717
- dupword
18+
- err113
1819
- errcheck
1920
- errchkjson
2021
- errname
@@ -33,12 +34,10 @@ linters:
3334
- gocritic
3435
- gocyclo
3536
- godox
36-
- goerr113
3737
- gofmt
3838
- gofumpt
3939
- goheader
4040
- goimports
41-
- gomnd
4241
- gomoddirectives
4342
- gomodguard
4443
- goprintffuncname
@@ -55,6 +54,7 @@ linters:
5554
- maintidx
5655
- mirror
5756
- misspell
57+
- mnd
5858
- nakedret
5959
- nestif
6060
- nilerr
@@ -180,4 +180,4 @@ issues:
180180

181181
- text: "do not define dynamic errors" ## dynamic errors are okay is this is simple tool
182182
linters:
183-
- goerr113
183+
- err113

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GO ?= go
22
GOBIN ?= $$($(GO) env GOPATH)/bin
33
GOLANGCI_LINT ?= $(GOBIN)/golangci-lint
4-
GOLANGCI_LINT_VERSION ?= v1.56.2
4+
GOLANGCI_LINT_VERSION ?= v1.59.1
55

66
# Code tidy
77
.PHONY: tidy

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (args) Version() string {
8181
return Name + " " + Version
8282
}
8383

84-
//nolint:cyclop,maintidx,gomnd // relax
84+
//nolint:cyclop,maintidx,mnd // relax
8585
func (a *args) overrideConfig(cfg testcoverage.Config) (testcoverage.Config, error) {
8686
if !isCIDefaultString(a.Profile) {
8787
cfg.Profile = a.Profile

pkg/testcoverage/badge/generate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func Generate(coverage int) ([]byte, error) {
2121
}
2222

2323
func Color(coverage int) string {
24-
//nolint:gomnd // relax
24+
//nolint:mnd // relax
2525
switch {
2626
case coverage >= 100:
2727
return "#44cc11" // strong green

pkg/testcoverage/badge_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func Test_GenerateAndSaveBadge_SaveToFile(t *testing.T) {
3030

3131
const coverage = 100
3232

33-
testFile := t.TempDir() + "/badge.svg" //nolint:goconst // relax
33+
testFile := t.TempDir() + "/badge.svg"
3434
buf := &bytes.Buffer{}
3535
err := GenerateAndSaveBadge(buf, Config{
3636
Badge: Badge{

pkg/testcoverage/badgestorer/file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ func NewFile(filename string) Storer {
1010
return &fileStorer{filename: filename}
1111
}
1212

13-
//nolint:gosec,gomnd,wrapcheck // relax
13+
//nolint:gosec,mnd,wrapcheck // relax
1414
func (s *fileStorer) Store(data []byte) (bool, error) {
1515
err := os.WriteFile(s.filename, data, 0o644)
1616
if err != nil {

pkg/testcoverage/check_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func TestCheckNoParallel(t *testing.T) {
164164
})
165165

166166
t.Run("ok pass; with github output file", func(t *testing.T) {
167-
testFile := t.TempDir() + "/ga.output" //nolint: goconst // relax
167+
testFile := t.TempDir() + "/ga.output"
168168
t.Setenv(GaOutputFileEnv, testFile)
169169

170170
buf := &bytes.Buffer{}

pkg/testcoverage/coverage/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func (s Stats) CoveredPercentage() int {
1818
return CoveredPercentage(s.Total, s.Covered)
1919
}
2020

21-
//nolint:gomnd // relax
21+
//nolint:mnd // relax
2222
func CoveredPercentage(total, covered int64) int {
2323
if total == 0 {
2424
return 0

pkg/testcoverage/report.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func ReportForHuman(w io.Writer, result AnalyzeResult) {
1717
out := bufio.NewWriter(w)
1818
defer out.Flush()
1919

20-
tabber := tabwriter.NewWriter(out, 1, 8, 2, '\t', 0) //nolint:gomnd // relax
20+
tabber := tabwriter.NewWriter(out, 1, 8, 2, '\t', 0) //nolint:mnd // relax
2121
defer tabber.Flush()
2222

2323
statusStr := func(passing bool) string {
@@ -124,7 +124,7 @@ func SetGithubActionOutput(result AnalyzeResult) error {
124124
}
125125

126126
func openGitHubOutput(p string) (io.WriteCloser, error) {
127-
//nolint:gomnd,wrapcheck // error is wrapped at level above
127+
//nolint:mnd,wrapcheck // error is wrapped at level above
128128
return os.OpenFile(p, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644)
129129
}
130130

0 commit comments

Comments
 (0)