1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-28 08:49:11 +02:00

Fix formatter and output

This commit is contained in:
mgechev 2018-01-27 23:03:07 -08:00
parent deb72d6238
commit cf63744a6a
3 changed files with 9 additions and 3 deletions

View File

@ -147,7 +147,11 @@ func getFiles() []string {
if err != nil {
panic(err)
}
matches = append(matches, m...)
for _, f := range m {
if strings.HasSuffix(f, ".go") {
matches = append(matches, f)
}
}
}
if excludeGlobs == "" {

View File

@ -20,7 +20,7 @@ func (f *Default) Name() string {
// Format formats the failures gotten from the lint.
func (f *Default) Format(failures <-chan lint.Failure, config lint.RulesConfig) (string, error) {
for failure := range failures {
fmt.Printf("%v%v: %s\n", failure.GetFilename(), failure.Position.Start, failure.Failure)
fmt.Printf("%v: %s\n", failure.Position.Start, failure.Failure)
}
return "", nil
}

View File

@ -60,7 +60,9 @@ func main() {
close(formatChan)
<-exitChan
fmt.Println(output)
if output != "" {
fmt.Println(output)
}
os.Exit(exitCode)
}