atc0005 / go-ci

Tooling for linting, testing and building Go applications

Home Page:https://hub.docker.com/r/atc0005/go-ci

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

linters:
enable:
- depguard

linters:
enable:
- depguard

linters:
enable:
- depguard

References