1
0
mirror of https://github.com/mgechev/revive.git synced 2025-01-06 03:04:06 +02:00

adds "exclude" knob in configuration (#505)

This commit is contained in:
SalvadorC 2021-03-20 23:43:44 +01:00 committed by GitHub
parent f8f4bf23a4
commit 93b26c7949
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -29,4 +29,5 @@ type Config struct {
ErrorCode int `toml:"errorCode"`
WarningCode int `toml:"warningCode"`
Directives DirectivesConfig `toml:"directive"`
Exclude []string `toml:"exclude"`
}

View File

@ -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())