depguard: migrate to v2 (#3795)

This commit is contained in:
Ludovic Fernandez 2023-04-23 17:56:47 +02:00 committed by GitHub
parent cec16b68ab
commit fb746c4b04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 135 additions and 278 deletions

View file

@ -253,12 +253,18 @@ type Cyclop struct {
}
type DepGuardSettings struct {
ListType string `mapstructure:"list-type"`
Packages []string
IncludeGoRoot bool `mapstructure:"include-go-root"`
PackagesWithErrorMessage map[string]string `mapstructure:"packages-with-error-message"`
IgnoreFileRules []string `mapstructure:"ignore-file-rules"`
AdditionalGuards []DepGuardSettings `mapstructure:"additional-guards"`
Rules map[string]*DepGuardList `mapstructure:"rules"`
}
type DepGuardList struct {
Files []string `mapstructure:"files"`
Allow []string `mapstructure:"allow"`
Deny []DepGuardDeny `mapstructure:"deny"`
}
type DepGuardDeny struct {
Pkg string `mapstructure:"pkg"`
Desc string `mapstructure:"desc"`
}
type DecorderSettings struct {