Skip to content

Commit

Permalink
refactor(gotools): 馃摑 add verbose handling for golangci-lint tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
sheldonhull committed Sep 17, 2021
1 parent 82964d5 commit 01ca636
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gotools/gotools.go
Expand Up @@ -36,8 +36,12 @@ func (Golang) Init() error {

// 馃攷 Lint runs golangci-lint tooling.
func (Golang) Lint() error {
var vflag string
if mg.Verbose() {
vflag = "-v"
}
pterm.Info.Println("Running golangci-lint")
if err := tooling.RunTool("golangci-lint", "run", "./..."); err != nil {
if err := tooling.RunTool("golangci-lint", "run", "./...", vflag); err != nil {
return err
}

Expand All @@ -55,7 +59,7 @@ func (Golang) Fmt() error {
}()

p.Title = "gofmt"
if err := sh.Run("gofmt", "-s", "-w", "."); err != nil {
if err := tooling.RunTool("gofmt", "-s", "-w", "."); err != nil {
return err
}
p.Increment()
Expand Down

0 comments on commit 01ca636

Please sign in to comment.