Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.golangci.reference.yml validation #3613

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
79 changes: 41 additions & 38 deletions .golangci.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
19 changes: 19 additions & 0 deletions pkg/config/reader_test.go
Original file line number Diff line number Diff line change
@@ -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)
}
}