Skip to content

source does not recognize specific regex expressions #2774

@rexagod

Description

@rexagod

Welcome

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).
  • Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

Description of the problem

Specifying \w for the issues.exclude-rules.linters[*].source field throws error saying that it's not recognized.

Version of golangci-lint

Details
# 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

Details
$ 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

Details
$ 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

Details
$ 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

Details

rexagod/mcg-osd-deployer

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions