Skip to content

Commit

Permalink
fix: linters
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienaury committed Oct 11, 2022
1 parent 1540f34 commit e6ba22a
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 15 deletions.
6 changes: 6 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
"--disable", "scopelint",
"--disable", "interfacer",
"--disable", "maligned",
"--disable", "varcheck",
"--disable", "ifshort",
"--disable", "exhaustivestruct",
"--disable", "nosnakecase",
"--disable", "structcheck",
"--disable", "deadcode",
],
// Golang on save
"go.buildOnSave": "workspace",
Expand Down
15 changes: 14 additions & 1 deletion build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,20 @@ properties:
buildpaths: [] # By default, all paths under the cmd/ folder are built, specify a different folder list with `-props "{buildpaths: ["other/path", "to/build"]}"`
linters: [] # List of linters to run on the lint target, if left empty : run all linters
lintersno: # List of linters to exclude on running the lint target
["scopelint", "interfacer", "maligned", "forbidigo", "gci", "golint"]
[
"scopelint",
"interfacer",
"maligned",
"forbidigo",
"gci",
"golint",
"structcheck",
"deadcode",
"varcheck",
"ifshort",
"nosnakecase",
"exhaustivestruct",
]
snapshot: false # If true, do not upload release when publish target is used
dockerfiles: # List of Dockerfiles to build, defined by a map of {key=Dockerfile name ; value=path to build context}, the image name will be determined by the extension of the Dockerfile
Dockerfile: . # Build a file named Dockerfile at the root of the workspace, will produce image name "<DOCKERHUB_USER>/<PROJECT>"
Expand Down
17 changes: 10 additions & 7 deletions cmd/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,21 @@ import (
"github.com/rs/zerolog/log"
)

// Provisioned by ldflags
// nolint: gochecknoglobals
// Provisioned by ldflags.
var (
name string
version string
commit string
//nolint: gochecknoglobals
name string
version string
//nolint: gochecknoglobals
commit string
//nolint: gochecknoglobals
buildDate string
builtBy string
//nolint: gochecknoglobals
builtBy string
)

func main() {
// nolint: exhaustivestruct
//nolint: exhaustruct
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})

log.Info().Msgf("%v %v (commit=%v date=%v by=%v)", name, version, commit, buildDate, builtBy)
Expand Down
17 changes: 10 additions & 7 deletions cmd/webserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,21 @@ import (
"github.com/rs/zerolog/log"
)

// Provisioned by ldflags
// nolint: gochecknoglobals
// Provisioned by ldflags.
var (
name string
version string
commit string
//nolint: gochecknoglobals
name string
version string
//nolint: gochecknoglobals
commit string
//nolint: gochecknoglobals
buildDate string
builtBy string
//nolint: gochecknoglobals
builtBy string
)

func main() {
// nolint: exhaustivestruct
//nolint: exhaustruct
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
log.Info().Msgf("%v %v (commit=%v date=%v by=%v)", name, version, commit, buildDate, builtBy)
log.Info().Msg("This is the web server.")
Expand Down

0 comments on commit e6ba22a

Please sign in to comment.