From 5d8360f26aaf319bafe05b1bf682495a51c04e72 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 09:24:50 +0000 Subject: [PATCH 1/2] build(deps): bump github.com/OpenPeeDeeP/depguard/v2 from 2.1.0 to 2.2.0 Bumps [github.com/OpenPeeDeeP/depguard/v2](https://github.com/OpenPeeDeeP/depguard) from 2.1.0 to 2.2.0. - [Release notes](https://github.com/OpenPeeDeeP/depguard/releases) - [Commits](https://github.com/OpenPeeDeeP/depguard/compare/v2.1.0...v2.2.0) --- updated-dependencies: - dependency-name: github.com/OpenPeeDeeP/depguard/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 66c1dd461952..f5c36b856a29 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/BurntSushi/toml v1.3.2 github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0 - github.com/OpenPeeDeeP/depguard/v2 v2.1.0 + github.com/OpenPeeDeeP/depguard/v2 v2.2.0 github.com/alecthomas/go-check-sumtype v0.1.3 github.com/alexkohler/nakedret/v2 v2.0.2 github.com/alexkohler/prealloc v1.0.0 diff --git a/go.sum b/go.sum index a2ed22f700b1..a95d3e50d156 100644 --- a/go.sum +++ b/go.sum @@ -60,8 +60,8 @@ github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0 h1:3ZBs7LAezy8gh0uECsA6C github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0/go.mod h1:rZLTje5A9kFBe0pzhpe2TdhRniBF++PRHQuRpR8esVc= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/OpenPeeDeeP/depguard/v2 v2.1.0 h1:aQl70G173h/GZYhWf36aE5H0KaujXfVMnn/f1kSDVYY= -github.com/OpenPeeDeeP/depguard/v2 v2.1.0/go.mod h1:PUBgk35fX4i7JDmwzlJwJ+GMe6NfO1723wmJMgPThNQ= +github.com/OpenPeeDeeP/depguard/v2 v2.2.0 h1:vDfG60vDtIuf0MEOhmLlLLSzqaRM8EMcgJPdp74zmpA= +github.com/OpenPeeDeeP/depguard/v2 v2.2.0/go.mod h1:CIzddKRvLBC4Au5aYP/i3nyaWQ+ClszLIuVocRiCYFQ= github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= github.com/alecthomas/go-check-sumtype v0.1.3 h1:M+tqMxB68hcgccRXBMVCPI4UJ+QUfdSx0xdbypKCqA8= github.com/alecthomas/go-check-sumtype v0.1.3/go.mod h1:WyYPfhfkdhyrdaligV6svFopZV8Lqdzn5pyVBaV6jhQ= From 6d16528e6be5aa1311e95fcaf9a81487f856676d Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Fri, 17 Nov 2023 10:37:53 +0100 Subject: [PATCH 2/2] chore: update implementation --- .golangci.reference.yml | 4 ++++ pkg/config/linters_settings.go | 7 ++++--- pkg/golinters/depguard.go | 5 +++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.golangci.reference.yml b/.golangci.reference.yml index 878597c38f45..5476b5ad8563 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -205,6 +205,10 @@ linters-settings: rules: # Name of a rule. main: + # Used to determine the package matching priority. + # There are three different modes: `original`, `strict`, and `lax`. + # Default: "original" + list-mode: lax # List of file globs that will match this list of settings to compare against. # Default: $all files: diff --git a/pkg/config/linters_settings.go b/pkg/config/linters_settings.go index 5f85059b5873..c75e7978e391 100644 --- a/pkg/config/linters_settings.go +++ b/pkg/config/linters_settings.go @@ -289,9 +289,10 @@ type DepGuardSettings struct { } type DepGuardList struct { - Files []string `mapstructure:"files"` - Allow []string `mapstructure:"allow"` - Deny []DepGuardDeny `mapstructure:"deny"` + ListMode string `mapstructure:"list-mode"` + Files []string `mapstructure:"files"` + Allow []string `mapstructure:"allow"` + Deny []DepGuardDeny `mapstructure:"deny"` } type DepGuardDeny struct { diff --git a/pkg/golinters/depguard.go b/pkg/golinters/depguard.go index 23986708c931..49e471df824d 100644 --- a/pkg/golinters/depguard.go +++ b/pkg/golinters/depguard.go @@ -15,8 +15,9 @@ func NewDepguard(settings *config.DepGuardSettings) *goanalysis.Linter { if settings != nil { for s, rule := range settings.Rules { list := &depguard.List{ - Files: rule.Files, - Allow: rule.Allow, + ListMode: rule.ListMode, + Files: rule.Files, + Allow: rule.Allow, } // because of bug with Viper parsing (split on dot) we use a list of struct instead of a map.