Skip to content

Commit

Permalink
chore: Lints
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlehoux committed Sep 28, 2024
1 parent 2d6e6fa commit 48aba2f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
10 changes: 5 additions & 5 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ set -ev
gofmt -d -e -s .
go vet ./...
go run github.com/martinlehoux/kagamigo/cmd/cvet ./...
staticcheck ./...
gosec -quiet ./...
gocyclo -over 10 -ignore '.*_templ\.go' .
golangci-lint run
go run honnef.co/go/tools/cmd/staticcheck ./...
go run github.com/securego/gosec/v2/cmd/gosec -quiet ./...
go run github.com/fzipp/gocyclo/cmd/gocyclo -over 10 -ignore '.*_templ\.go' .
go run github.com/golangci/golangci-lint/cmd/golangci-lint run
go test ./...
go mod tidy
go mod tidy
3 changes: 1 addition & 2 deletions cmd/cvet/check_command.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"fmt"
"go/ast"
"go/token"
"strings"
Expand Down Expand Up @@ -37,7 +36,7 @@ func loggerCommandKeyValueArgFinder(pass *analysis.Pass, commandName string) fun

value := secondArg.Value[1 : len(secondArg.Value)-1]
if value != commandName {
pass.Reportf(arg.Pos(), fmt.Sprintf("logger command name must be function name %s, but found %s", commandName, value))
pass.Reportf(arg.Pos(), "logger command name must be function name %s, but found %s", commandName, value)
return true
}
return true
Expand Down
2 changes: 1 addition & 1 deletion kauth/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func decrypt(secret []byte, encryptedText string) (string, error) {
return "", ErrEncryptedTooShort
}
nonce, cipherText := encryptedBytes[:nonceSize], encryptedBytes[nonceSize:]
plainBytes, err := aead.Open(nil, nonce, cipherText, nil)
plainBytes, err := aead.Open(nil, nonce, cipherText, nil) // #nosec G407
if err != nil {
err = kcore.Wrap(err, "error decrypting")
return "", err
Expand Down
10 changes: 10 additions & 0 deletions tools.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build tools

package main

import (
_ "github.com/fzipp/gocyclo/cmd/gocyclo"
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
_ "github.com/securego/gosec/v2/cmd/gosec"
_ "honnef.co/go/tools/cmd/staticcheck"
)

0 comments on commit 48aba2f

Please sign in to comment.