Skip to content

Commit

Permalink
adds "exclude" knob in configuration (#505)
Browse files Browse the repository at this point in the history
  • Loading branch information
chavacava committed Mar 20, 2021
1 parent f8f4bf2 commit 93b26c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lint/config.go
Expand Up @@ -29,4 +29,5 @@ type Config struct {
ErrorCode int `toml:"errorCode"`
WarningCode int `toml:"warningCode"`
Directives DirectivesConfig `toml:"directive"`
Exclude []string `toml:"exclude"`
}
5 changes: 5 additions & 0 deletions main.go
Expand Up @@ -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())
Expand Down

0 comments on commit 93b26c7

Please sign in to comment.