Skip to content

Commit

Permalink
update linter config for new version of depguard
Browse files Browse the repository at this point in the history
  • Loading branch information
Russ Egan committed Jan 12, 2024
1 parent d685cba commit cbc86b8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
29 changes: 22 additions & 7 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,28 @@ linters-settings:
# minimal occurrences count to trigger, 3 by default
min-occurrences: 3
depguard:
list-type: blacklist
include-go-root: false
packages:
- github.com/magiconair/properties/assert
inTests:
- github.com/davecgh/go-spew/spew
- github.com/stretchr/testify
rules:
# Name of a rule.
all:
# List of file globs that will match this list of settings to compare against.
# Default: $all
files:
- $all
# List of allowed packages.
# allow:
# - $gostd
# Packages that are not allowed where the value is a suggestion.
deny:
- pkg: github.com/magiconair/properties/assert
desc: Use testify/assert package instead
main:
files:
- "!$test"
deny:
- pkg: github.com/davecgh/go-spew/spew
desc: spew is usually only used in tests
- pkg: github.com/stretchr/testify
desc: testify is usually only used in tests
gomodguard:
blocked:
modules:
Expand Down
4 changes: 2 additions & 2 deletions log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func TestNew(t *testing.T) {

}

func TestTwo(t *testing.T) {
func TestTwo(_ *testing.T) {
// f := NewFactory()
f := pkgFactory
config := NewEncoderConfig()
Expand All @@ -115,7 +115,7 @@ func TestTwo(t *testing.T) {
l.Info("hi mom", "color", 5)
}

func TestBinary(t *testing.T) {
func TestBinary(_ *testing.T) {
f := NewFactory()
l := f.NewLogger("")
f.SetDefaultLevel(DebugLevel)
Expand Down

0 comments on commit cbc86b8

Please sign in to comment.