Skip to content

Commit

Permalink
lint bump to v1.59.1 (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladopajic authored Jul 23, 2024
1 parent 68c1012 commit 1a74492
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
version: v1.59.1
- name: go mod tidy check
uses: katexochen/go-tidy-check@v2
6 changes: 3 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ linters:
- dupl
- durationcheck
- dupword
- err113
- errcheck
- errchkjson
- errname
Expand All @@ -33,12 +34,10 @@ linters:
- gocritic
- gocyclo
- godox
- goerr113
- gofmt
- gofumpt
- goheader
- goimports
- gomnd
- gomoddirectives
- gomodguard
- goprintffuncname
Expand All @@ -55,6 +54,7 @@ linters:
- maintidx
- mirror
- misspell
- mnd
- nakedret
- nestif
- nilerr
Expand Down Expand Up @@ -180,4 +180,4 @@ issues:

- text: "do not define dynamic errors" ## dynamic errors are okay is this is simple tool
linters:
- goerr113
- err113
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GO ?= go
GOBIN ?= $$($(GO) env GOPATH)/bin
GOLANGCI_LINT ?= $(GOBIN)/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.56.2
GOLANGCI_LINT_VERSION ?= v1.59.1

# Code tidy
.PHONY: tidy
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (args) Version() string {
return Name + " " + Version
}

//nolint:cyclop,maintidx,gomnd // relax
//nolint:cyclop,maintidx,mnd // relax
func (a *args) overrideConfig(cfg testcoverage.Config) (testcoverage.Config, error) {
if !isCIDefaultString(a.Profile) {
cfg.Profile = a.Profile
Expand Down
2 changes: 1 addition & 1 deletion pkg/testcoverage/badge/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func Generate(coverage int) ([]byte, error) {
}

func Color(coverage int) string {
//nolint:gomnd // relax
//nolint:mnd // relax
switch {
case coverage >= 100:
return "#44cc11" // strong green
Expand Down
2 changes: 1 addition & 1 deletion pkg/testcoverage/badge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Test_GenerateAndSaveBadge_SaveToFile(t *testing.T) {

const coverage = 100

testFile := t.TempDir() + "/badge.svg" //nolint:goconst // relax
testFile := t.TempDir() + "/badge.svg"
buf := &bytes.Buffer{}
err := GenerateAndSaveBadge(buf, Config{
Badge: Badge{
Expand Down
2 changes: 1 addition & 1 deletion pkg/testcoverage/badgestorer/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func NewFile(filename string) Storer {
return &fileStorer{filename: filename}
}

//nolint:gosec,gomnd,wrapcheck // relax
//nolint:gosec,mnd,wrapcheck // relax
func (s *fileStorer) Store(data []byte) (bool, error) {
err := os.WriteFile(s.filename, data, 0o644)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/testcoverage/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func TestCheckNoParallel(t *testing.T) {
})

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

buf := &bytes.Buffer{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/testcoverage/coverage/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (s Stats) CoveredPercentage() int {
return CoveredPercentage(s.Total, s.Covered)
}

//nolint:gomnd // relax
//nolint:mnd // relax
func CoveredPercentage(total, covered int64) int {
if total == 0 {
return 0
Expand Down
4 changes: 2 additions & 2 deletions pkg/testcoverage/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func ReportForHuman(w io.Writer, result AnalyzeResult) {
out := bufio.NewWriter(w)
defer out.Flush()

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

statusStr := func(passing bool) string {
Expand Down Expand Up @@ -124,7 +124,7 @@ func SetGithubActionOutput(result AnalyzeResult) error {
}

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

Expand Down

0 comments on commit 1a74492

Please sign in to comment.