Skip to content

linters-settings.thelper.test.name not working #2848

Closed
@powerman

Description

@powerman

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

It's impossible to disable thelper's "t_name" check using .golangci.yml.

Version of golangci-lint

$ golangci-lint --version
golangci-lint has version 1.46.0 built from 7c1d8b75 on 2022-05-09T11:16:24Z

Configuration file

$ cat .golangci.yml
linters-settings:
  thelper:
    test:
      name: false

linters:
  disable-all: true
  enable:
    - thelper

Go environment

$ go version && go env
go version go1.18.2 linux/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/powerman/.cache/go-build"
GOENV="/home/powerman/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/powerman/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/powerman/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.2"
GCCGO="gccgo"
GOAMD64="v3"
AR="ar"
CC="x86_64-pc-linux-gnu-gcc"
CXX="x86_64-pc-linux-gnu-g++"
CGO_ENABLED="1"
GOMOD="/home/powerman/tmp/go/bug-golangci-lint-thelper/go.mod"
GOWORK=""
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-build3888433916=/tmp/go-build -gno-record-gcc-switches"

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
bug_test.go:5:6: parameter *testing.T should have name t (thelper)                               
func helper(tt *testing.T) {
     ^

Code example or link to a public repository

package bug_test

import "testing"

func helper(tt *testing.T) {
	tt.Helper()
}

func Test(tt *testing.T) {
	tt.Parallel()
	helper(tt)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions