in admin/lint/lint.go [84:132]
func main() {
verbose := flag.Bool("verbose", false, "Enables extra logging")
workspace := flag.String("workspace", ".", "Path to the directory where the source tree lives; used to find source files (symlinks are followed) and to resolve relative paths to sources")
flag.Parse()
if *verbose {
log.SetOutput(os.Stderr)
} else {
log.SetOutput(ioutil.Discard)
}
var relFiles []string
if len(flag.Args()) == 0 {
log.Printf("Searching for source files in %s", *workspace)
var err error
relFiles, err = collectFiles(*workspace)
if err != nil {
fmt.Fprintf(os.Stderr, "ERROR: %s\n", err)
os.Exit(1)
}
} else {
for _, file := range flag.Args() {
if filepath.IsAbs(file) {
fmt.Fprintf(os.Stderr, "ERROR: Explicitly-provided file names must be relative; %s was not\n", file)
os.Exit(1)
}
}
relFiles = flag.Args()
}
files := make([]string, 0, len(relFiles))
for _, file := range relFiles {
if isBlacklisted(file) {
log.Printf("Skipping linting of %s because it is blacklisted", file)
} else {
files = append(files, filepath.Join(*workspace, file))
}
}
failed := false
for _, file := range files {
if !checkAll(*workspace, file) {
failed = true
}
}
if failed {
os.Exit(1)
}
}