-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
depguard integration unnecessarily type checks #2670
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
Hello, the use of
We use an adapter because depguard use the old and deprecated |
@ldez Thanks, your PR makes the change mentioned in the issue description
Awesome! |
Welcome
Description of the problem
The
depguard
golangci-lint integration unnecessarily type checks.When run standalone
depguard
does not experience this issue.When run via golangci-lint this issue is experienced, resulting in
typecheck
lints (catching the compilation errors).Example to reproduce: edit test/testdata/depguard.go
run
go run ./cmd/golangci-lint/ run --no-config --disable-all --enable=depguard ./test/testdata/depguard.go
Separately you can run
depguard
directly - to confirm that no errors are produced bydepguard
itself - by runninggo run ./cmd/depguard -c ".depguard.json" <path_to>/golangci-lint/test/testdata/depguard.go
where.depguard.json
is some minimal depguard configuration.This can be resolved by using
LoadModeSyntax
and using a modifiedMakeFakeLoaderProgram
that doesn't attempt to access*pass.TypesInfo
.(
revive
, for example, doesn't experience this issue)Version of golangci-lint
Configuration file
$ cat .golangci.yml
Go environment
Verbose output of running
Code example or link to a public repository
The text was updated successfully, but these errors were encountered: