From 93b26c7949134ce6434c2cc2d7206e013f2fa536 Mon Sep 17 00:00:00 2001 From: SalvadorC Date: Sat, 20 Mar 2021 23:43:44 +0100 Subject: [PATCH] adds "exclude" knob in configuration (#505) --- lint/config.go | 1 + main.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lint/config.go b/lint/config.go index fe65ace52..e05460874 100644 --- a/lint/config.go +++ b/lint/config.go @@ -29,4 +29,5 @@ type Config struct { ErrorCode int `toml:"errorCode"` WarningCode int `toml:"warningCode"` Directives DirectivesConfig `toml:"directive"` + Exclude []string `toml:"exclude"` } diff --git a/main.go b/main.go index 6451ecfd7..fc5158581 100644 --- a/main.go +++ b/main.go @@ -29,6 +29,11 @@ func main() { if err != nil { fail(err.Error()) } + + if len(excludePaths) == 0 { // if no excludes were set in the command line + excludePaths = conf.Exclude // use those from the configuration + } + packages, err := getPackages(excludePaths) if err != nil { fail(err.Error())