Skip to content

Commit

Permalink
fix: linters
Browse files Browse the repository at this point in the history
  • Loading branch information
krogon committed Jun 24, 2024
1 parent 6a4f7e1 commit 082fec7
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 12 deletions.
108 changes: 96 additions & 12 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,122 @@
linters:
disable-all: true
enable:
# default
- deadcode
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck
# added

# addition
- asasalint
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- containedctx
- contextcheck
- copyloopvar
- cyclop
- decorder
- depguard
- dogsled
- dupl
- dupword
- durationcheck
- err113
- errchkjson
- errname
- errorlint
- execinquery
- exhaustive
- exhaustruct
- exportloopref
- fatcontext
- forbidigo
- forcetypeassert
- funlen
- gci
- ginkgolinter
- gocheckcompilerdirectives
- gochecknoglobals
- gochecknoinits
- gochecksumtype
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- godox
- gofmt
- gofumpt
- goheader
- goimports
- interfacer
- maligned
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosmopolitan
- grouper
- importas
- inamedparam
- interfacebloat
- intrange
- ireturn
- lll
- loggercheck
- maintidx
- makezero
- mirror
- misspell
- mnd
- musttag
- nakedret
- nestif
- nilerr
- nilnil
- nlreturn
- noctx
- nolintlint
- nonamedreturns
- nosprintfhostport
- paralleltest
- perfsprint
- prealloc
- scopelint
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- stylecheck
- tagalign
- tagliatelle
- tenv
- testableexamples
- testifylint
- testpackage
- thelper
- tparallel
- unconvert
- unparam
- gosec
- golint
- gochecknoglobals
- lll # hard to fulfill
- usestdlibvars
- varnamelen
- wastedassign
- whitespace
- wrapcheck
- wsl
- zerologlint

run:
modules-download-mode: vendor
modules-download-mode: readonly
go: '1.19'
tests: false

output:
show-stats: true
1 change: 1 addition & 0 deletions internal/pkg/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func executeLatestTag(cmd *cobra.Command, args []string) {
})
if response != nil && response.StatusCode == http.StatusNotFound {
cmd.Print("v0.0.0")

return
}
action.AssertNoError(cmd, err, "could not list git refs: %s", err)
Expand Down
2 changes: 2 additions & 0 deletions internal/pkg/release/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ func execute(cmd *cobra.Command, releaseType string, args []string) {
if err := createGithubRelease(ctx, client, repo, release); err != nil {
action.AssertNoError(cmd, err, "could not create GitHub release: %s", err)
}

return
case releaseTypeTag:
if err := createLightweightTag(ctx, client, repo, release); err != nil {
action.AssertNoError(cmd, err, "could not create lightweight tag: %s", err)
}

return
default:
action.Fail(cmd, "unknown release strategy: %s", releaseType)
Expand Down

0 comments on commit 082fec7

Please sign in to comment.