Skip to content

Commit

Permalink
Show given paths while running
Browse files Browse the repository at this point in the history
  • Loading branch information
nakabonne committed May 6, 2020
1 parent f4345d5 commit 6bb3dda
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
11 changes: 11 additions & 0 deletions pkg/golangcilint/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@ func (r *Runner) GetVersion() string {
return string(version)
}

func (r *Runner) ArgsString() string {
paths := ""
if len(r.Args) == 0 {
return "./..."
}
for _, arg := range r.Args {
paths += arg + ", "
}
return paths
}

func (r *Runner) run(targets []string) ([]byte, error) {
args := []string{"run", "--out-format=json", "--issues-exit-code=0"}

Expand Down
5 changes: 4 additions & 1 deletion pkg/gui/keybindings.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package gui

import (
"fmt"

"github.com/gdamore/tcell"
)

Expand All @@ -22,7 +24,8 @@ func (g *Gui) grobalKeybind(event *tcell.EventKey) {
case 'q':
g.application.Stop()
case 'r':
close := g.showLoading("running linters...")
paths := g.runner.ArgsString()
close := g.showLoading("running linters...", fmt.Sprintf("given paths: %s", paths))

go func() {
issues, err := g.runner.Run()
Expand Down

0 comments on commit 6bb3dda

Please sign in to comment.