Skip to content

Commit

Permalink
updated golangci settings and code according to it
Browse files Browse the repository at this point in the history
  • Loading branch information
mpapenbr committed Nov 14, 2023
1 parent bb00e88 commit be1537f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 20 deletions.
21 changes: 9 additions & 12 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ linters-settings:
sections:
- standard # standard packages
- default # all other imports that do not fall in any group
- prefix(github.com/mpapenbr/iracelog-wamp-router) # internal imports from `iracelog-wamp-router`
- prefix(github.com/mpapenbr/iracelog-service-manager-go) # internal imports from `iracelog-service-manager-go`
section-separators:
- newLine

Expand Down Expand Up @@ -233,7 +233,7 @@ linters-settings:
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: "github.com/mpapenbr/iracelog-wamp-router"
local-prefixes: "github.com/mpapenbr/iracelog-service-manager-go"

golint:
# minimal confidence for issues, default is 0.8
Expand Down Expand Up @@ -261,7 +261,7 @@ linters-settings:
# - G204

gosimple:
go: "1.20" # version to target - default is '1.13'
go: "1.21" # version to target - default is '1.13'
checks: ["all"] # https://staticcheck.io/docs/options#checks for more info

govet:
Expand Down Expand Up @@ -466,20 +466,18 @@ linters:
disable-all: true # disable all, selectively enable what is needed
enable:
# Defaults
- deadcode
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck


# Additional
- cyclop
- depguard
# - depguard
- dogsled
- dupl
- errname
Expand All @@ -495,28 +493,27 @@ linters:
- gofumpt
- funlen
- goimports
# - gomnd # very noisy
# - gomnd too noisy
- goprintffuncname
- gosec
- ifshort
- lll
- makezero
- misspell
- nakedret
- nestif
- nilerr
- noctx
- nolintlint
# - nolintlint
- predeclared
- revive
# - stylecheck # very noisy
# - stylecheck too noisy
- tagliatelle
- thelper
- unconvert
- unparam
- wastedassign
- whitespace
# - wrapcheck # very noisy
# - wrapcheck too noisy

# Interesting linters - enable if they fit your needs
# - maintidx
Expand Down
5 changes: 2 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ import (
"os"
"strings"

serverCmd "github.com/mpapenbr/iracelog-wamp-router/pkg/cmd/server"
"github.com/mpapenbr/iracelog-wamp-router/version"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"

serverCmd "github.com/mpapenbr/iracelog-wamp-router/pkg/cmd/server"
"github.com/mpapenbr/iracelog-wamp-router/version"
)

const envPrefix = "IWR"
Expand Down
3 changes: 1 addition & 2 deletions pkg/cmd/server/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"os"

"github.com/drone/envsubst"
"gopkg.in/yaml.v3"

"github.com/mpapenbr/iracelog-wamp-router/pkg/config"
"gopkg.in/yaml.v3"
)

type racelogAuth struct {
Expand Down
1 change: 0 additions & 1 deletion pkg/cmd/server/authorization.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package server

import (
"github.com/gammazero/nexus/v3/wamp"

"github.com/mpapenbr/iracelog-wamp-router/log"
"github.com/mpapenbr/iracelog-wamp-router/pkg/config"
)
Expand Down
3 changes: 1 addition & 2 deletions pkg/cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import (
"github.com/gammazero/nexus/v3/router"
"github.com/gammazero/nexus/v3/router/auth"
"github.com/gammazero/nexus/v3/wamp"
"github.com/spf13/cobra"

"github.com/mpapenbr/iracelog-wamp-router/log"
"github.com/mpapenbr/iracelog-wamp-router/pkg/config"
"github.com/spf13/cobra"
)

func NewServerCmd() *cobra.Command {
Expand Down

0 comments on commit be1537f

Please sign in to comment.