diff --git a/.golangci.reference.yml b/.golangci.reference.yml index 7de210b98ba4..be5b36f504d4 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -1018,48 +1018,51 @@ linters-settings: - unusedwrite # Enable all analyzers. + # enable-all and disable-all cannot both be true, therefore this section is + # commented out. + # # Default: false - enable-all: true + # enable-all: true # Disable analyzers by name. # Run `go tool vet help` to see all analyzers. # Default: [] - disable: - - asmdecl - - assign - - atomic - - atomicalign - - bools - - buildtag - - cgocall - - composites - - copylocks - - deepequalerrors - - errorsas - - fieldalignment - - findcall - - framepointer - - httpresponse - - ifaceassert - - loopclosure - - lostcancel - - nilfunc - - nilness - - printf - - reflectvaluecompare - - shadow - - shift - - sigchanyzer - - sortslice - - stdmethods - - stringintconv - - structtag - - testinggoroutine - - tests - - unmarshal - - unreachable - - unsafeptr - - unusedresult - - unusedwrite + # disable: + # - asmdecl + # - assign + # - atomic + # - atomicalign + # - bools + # - buildtag + # - cgocall + # - composites + # - copylocks + # - deepequalerrors + # - errorsas + # - fieldalignment + # - findcall + # - framepointer + # - httpresponse + # - ifaceassert + # - loopclosure + # - lostcancel + # - nilfunc + # - nilness + # - printf + # - reflectvaluecompare + # - shadow + # - shift + # - sigchanyzer + # - sortslice + # - stdmethods + # - stringintconv + # - structtag + # - testinggoroutine + # - tests + # - unmarshal + # - unreachable + # - unsafeptr + # - unusedresult + # - unusedwrite grouper: # Require the use of a single global 'const' declaration only. diff --git a/pkg/config/reader_test.go b/pkg/config/reader_test.go new file mode 100644 index 000000000000..93ba8e5ce7e8 --- /dev/null +++ b/pkg/config/reader_test.go @@ -0,0 +1,19 @@ +package config + +import ( + "testing" + + "github.com/golangci/golangci-lint/pkg/logutils" +) + +func TestReader(t *testing.T) { + var toCfg, commandLineCfg Config + logger := logutils.NewStderrLog("") + logger.SetLevel(logutils.LogLevelDebug) + + commandLineCfg.Run.Config = "../../.golangci.reference.yml" + reader := NewFileReader(&toCfg, &commandLineCfg, logger) + if err := reader.Read(); err != nil { + t.Fatalf("unexpected error reading .golangci.reference.yml: %v", err) + } +}