mirror of
https://github.com/mgechev/revive.git
synced 2025-09-16 09:06:22 +02:00
adds "exclude" knob in configuration (#505)
This commit is contained in:
@@ -29,4 +29,5 @@ type Config struct {
|
|||||||
ErrorCode int `toml:"errorCode"`
|
ErrorCode int `toml:"errorCode"`
|
||||||
WarningCode int `toml:"warningCode"`
|
WarningCode int `toml:"warningCode"`
|
||||||
Directives DirectivesConfig `toml:"directive"`
|
Directives DirectivesConfig `toml:"directive"`
|
||||||
|
Exclude []string `toml:"exclude"`
|
||||||
}
|
}
|
||||||
|
5
main.go
5
main.go
@@ -29,6 +29,11 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
fail(err.Error())
|
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)
|
packages, err := getPackages(excludePaths)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fail(err.Error())
|
fail(err.Error())
|
||||||
|
Reference in New Issue
Block a user