New version of depguard linter included in golangci-lint v1.53.0 and newer fails when run without explicit configuration
atc0005 opened this issue · comments
Overview
v2 of the depguard linter changes the default behavior of the linter. Now, when enabled in the golangci-lint
configuration but without an explicitly defined settings block the linter will emit errors like these:
internal\config\config.go:18:2: import 'github.com/rs/zerolog' is not allowed from list 'Main' (depguard)
"github.com/rs/zerolog"
^
internal\config\getters.go:13:2: import 'github.com/atc0005/go-nagios' is not allowed from list 'Main' (depguard)
"github.com/atc0005/go-nagios"
^
internal\config\logging.go:14:2: import 'github.com/rs/zerolog' is not allowed from list 'Main' (depguard)
"github.com/rs/zerolog"
^
This fails any CI runs which execute golangci-lint using current configurations.
Current settings
go-ci/oldstable/combined/.golangci.yml
Lines 26 to 28 in 5180a0c
go-ci/stable/combined/.golangci.yml
Lines 26 to 28 in 5180a0c
go-ci/unstable/combined/.golangci.yml
Lines 33 to 35 in 5180a0c