Skip to content

Commit 0b97cbd

Browse files
author
lhitchon
committed
use current directory if no filenames given
1 parent 954c0dd commit 0b97cbd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cli/app.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,6 @@ func main() {
142142
fmt.Println("No rules")
143143
os.Exit(-1)
144144
}
145-
if len(configFilenames) == 0 {
146-
fmt.Println("No files to lint")
147-
os.Exit(-1)
148-
}
149145
os.Exit(applyRules(ruleSets, configFilenames, linterOptions, DefaultReportWriter{Writer: os.Stdout}))
150146
}
151147

@@ -326,7 +322,11 @@ func loadFilenames(commandLineFilenames []string, profileFilenames []string) []s
326322
if len(commandLineFilenames) > 0 {
327323
return commandLineFilenames
328324
}
329-
return profileFilenames
325+
if len(profileFilenames) > 0 {
326+
return profileFilenames
327+
}
328+
// default to current directory if no filesnames given
329+
return []string{"."}
330330
}
331331

332332
func excludeFilenames(filenames []string, excludePatterns []string) []string {

0 commit comments

Comments
 (0)