-
Welcome
Description of the problemSpecifying Version of golangci-lint# Installed using pacman on 5.15.25-1-MANJARO
$ golangci-lint --version
golangci-lint has version v1.45.0 built from (unknown, modsum:"h1:T2oCVkYoeckBxcNS6DTYiSXN2QcTNuAWaHyLGfqzMlU=") on (unknown) Configuration file$ cat .golangci.yml
run:
concurrency: 8
go: "1.17"
output:
sort-results: true
format: tab
issues:
exclude-rules:
- linters:
- lll
source: "^//.kubebuilder:.*"
- linters:
- gci
source: "^Expected '\w'.*"
fix: true
linters-settings:
gci:
no-inline-comments: true
no-prefix-comments: true
linters:
enable:
- asciicheck
- bidichk
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- durationcheck
- errcheck
- errname
- errorlint
- exhaustive
- exportloopref
- forbidigo
- forcetypeassert
- gci
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- godox
- gofmt
- gofumpt
- goheader
- goimports
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosimple
- govet
- ifshort
- importas
- ineffassign
- ireturn
- lll
- makezero
- misspell
- nakedret
- nestif
- nilerr
- nilnil
- nlreturn
- noctx
- nolintlint
- paralleltest
- prealloc
- predeclared
- promlinter
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- structcheck
- stylecheck
- tagliatelle
- tenv
- thelper
- tparallel
- unconvert
- unparam
- unused
- varcheck
- varnamelen
- wastedassign
- whitespace
- wrapcheck
Go environment$ go version && go env
go version go1.17 linux/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN="/home/rexagod/go/bin/"
GOCACHE="/home/rexagod/.cache/go-build"
GOENV="/home/rexagod/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/rexagod/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/rexagod/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/rexagod/.go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/rexagod/.go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.17"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build433855073=/tmp/go-build -gno-record-gcc-switches"
Verbose output of running$ golangci-lint cache clean
$ golangci-lint run -v
ERRO Can't read config: can't read viper config: While parsing config: yaml: line 14: found unknown escape character Code example or link to a public repository |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
Beta Was this translation helpful? Give feedback.
-
Hello,
the error message is right: in a string, the escape character must be escaped.
edit: You also have a problem with your configuration: it is not - linters:
- gci
text: "Expected '\\w',.+" |
Beta Was this translation helpful? Give feedback.
-
I'm trying to skip the first two cases below by specifying the Nonetheless, this still fails. controllers/managedmcg_controller_test.go:23:2 gci Expected 'n', Found 'v' at controllers/managedmcg_controller_test.go[line 23,col 2]
main.go:25:14 gci Expected 'g', Found 'r' at main.go[line 25,col 14]
readinessProbe/main.go:16:1 gci Expected '\t', Found '\n' at readinessProbe/main.go[line 16,col 1]
templates/noobaa.go:20:2 gci Expected '_', Found '/' at templates/noobaa.go[line 20,col 2]
tests/suite_test.go:23:2 gci Expected '.', Found '"' at tests/suite_test.go[line 23,col 2] |
Beta Was this translation helpful? Give feedback.
Hello,
the error message is right: in a string, the escape character must be escaped.
edit:
You also have a problem with your configuration: it is not
source
buttext
.