Skip to content

v2.0.0: 'run' fails with no config file and 'migrate' issues warning #5600

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

Closed
1 of 2 tasks
julieta-311 opened this issue Mar 24, 2025 · 6 comments
Closed
1 of 2 tasks
Labels
question Further information is requested

Comments

@julieta-311
Copy link

julieta-311 commented Mar 24, 2025

How did you install golangci-lint?

go install

Description of the problem

Before I was running golangci-lint has version v1.64.5 built with go1.24.0 with con config file.
I've upgraded golangci to v2.0.0 and golangci-lint run . started returning the following error

Error: can't load config: typecheck is not a linter, it cannot be enabled or disabled
Failed executing command with error: can't load config: typecheck is not a linter, it cannot be enabled or disabled

Both golangci-lint config path and golangci-lint migrate return

WARN No config file detected

I've resolved this by creating a config file ~/.golangci.yaml.

See #5597 (comment).

Version of golangci-lint

$ golangci-lint --version
golangci-lint has version v2.0.0 built with go1.24.1 from (unknown, modified: ?, mod sum: "h1:RQWk8VCuMQv9bBDy3x23yds2yf9aRZ86C9MWGIdNRuU=") on (unknown)

Configuration

# paste configuration file or CLI flags here

Go environment

$ go version && go env
go version go1.24.1 darwin/arm64
AR='ar'
CC='cc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='c++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN='/Users/julieta/go/bin'
GOCACHE='/Users/julieta/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/julieta/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/40/91m3cbgs0w76fhq8z4cqqrr80000gq/T/go-build2076999620=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/julieta/x/core/go.mod'
GOMODCACHE='/Users/julieta/go/pkg/mod'
GOOS='darwin'
GOPATH='/Users/julieta/go'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.24.1/libexec'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/julieta/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.24.1/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.24.1'
GOWORK=''
PKG_CONFIG='pkg-config'

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
# paste output here

A minimal reproducible example or link to a public repository

Having no config file do

golangci-lint run .

Note that golangci-lint run --no-config . does work.

Validation

  • Yes, I've included all information above (version, config, etc.).

Supporter

@julieta-311 julieta-311 added the bug Something isn't working label Mar 24, 2025
Copy link

boring-cyborg bot commented Mar 24, 2025

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@ldez
Copy link
Member

ldez commented Mar 24, 2025

Thank you.

I'm not able to reproduce the problem:

  • no config file -> no error
  • --no-config flag -> no error
  • --no-config flag + a local configuration file -> no error

I need more information, can you provide the "Verbose output of running"?

@ldez ldez added the feedback required Requires additional feedback label Mar 24, 2025
@julieta-311
Copy link
Author

Thank you.

I'm not able to reproduce the problem:

  • no config file -> no error
  • --no-config flag -> no error
  • --no-config flag + a local configuration file -> no error

I need more information, can you provide the "Verbose output of running"?

I have tried running on a different project and I'm not getting this. Could it be related to the tool definitions in the go.mod file? It has the following

tool (
	golang.org/x/tools/cmd/stringer
	mvdan.cc/gofumpt
)

@ldez
Copy link
Member

ldez commented Mar 24, 2025

Could it be related to the tool definitions in the go.mod file?

I don't think so, go install is not influenced by the project's go.mod.

Maybe it was just a side effect related to an existing cache.

@ldez ldez added question Further information is requested and removed bug Something isn't working labels Mar 24, 2025
@ldez
Copy link
Member

ldez commented Mar 24, 2025

As neither you nor I can reproduce the problem, I will close the issue for now.
We will see if we have other issues on the topic.

@ldez ldez closed this as completed Mar 24, 2025
@julieta-311
Copy link
Author

I think I know what the problem was, I have some configuration set in my vimrc file, I had the following defined there

let g:go_metalinter_enabled = ['dogsled', 'errcheck', 'gofumpt', 'gosimple', 'govet', 'ineffassign', 'staticcheck', 'typecheck', 'unused']
let g:go_metalinter_autosave_enabled = ['dogsled', 'errcheck', 'gofumpt', 'gosimple', 'govet', 'ineffassign', 'staticcheck', 'typecheck', 'unused']

I commented that out and stopped getting the errors. I still find it very strange that that's causing issues outside of vim 🤷‍♀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants