-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Golangci-lint does not show revive exported
lints when using import "C"
#2449
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
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
Hello, I recommend adding |
Thank you for the suggestion, but adding Just in case I tried it anyway, so this is now my config: {
"linters": {
"disable-all": true,
"enable": [
"typecheck",
"revive"
]
},
"issues": {
"include": [
"EXC0012",
"EXC0013",
"EXC0014",
"EXC0015"
]
}
} After running the following... golangci-lint cache clean
golangci-lint run -v ...this is the output I get: level=info msg="[config_reader] Config search paths: [./ C:\\Users\\Polyscone\\Desktop\\bug C:\\Users\\Polyscone\\Desktop C:\\Users\\Polyscone C:\\Users C:\\ D:\\devenv]"
level=info msg="[config_reader] Used config file .golangci.json"
level=info msg="[lintersdb] Active 2 linters: [revive typecheck]"
level=info msg="[loader] Go packages loading at mode 575 (deps|exports_file|files|types_sizes|compiled_files|imports|name) took 572.5549ms"
level=info msg="[runner/filename_unadjuster] Pre-built 0 adjustments in 0s"
level=info msg="[linters context/goanalysis] analyzers took 2.728ms with top 10 stages: the_only_name: 2.728ms, typecheck: 0s"
level=info msg="[runner] processing took 0s with stages: path_prettifier: 0s, skip_files: 0s, skip_dirs: 0s, uniq_by_line: 0s, sort_results: 0s, autogenerated_exclude: 0s, exclude: 0s, diff: 0s, path_shortener: 0s, severity-rules: 0s, filename_unadjuster: 0s, identifier_marker: 0s, max_per_file_from_linter: 0s, max_from_linter: 0s, source_code: 0s, cgo: 0s, exclude-rules: 0s, nolint: 0s, max_same_issues: 0s, path_prefixer: 0s"
level=info msg="[runner] linters took 84.2395ms with stages: goanalysis_metalinter: 84.2395ms"
level=info msg="File cache stats: 0 entries of total size 0B"
level=info msg="Memory: 9 samples, avg is 50.6MB, max is 69.0MB"
level=info msg="Execution took 774.9253ms" So no new errors/warnings and the doc comment lints still aren't being shown. I also tried running Edit: |
Welcome
Description of the problem
When I enable the
revive
linter along with setting theinclude
configuration to include exported lints the linter output fails whenimport "C"
is used.I've been using cgo to call into SDL2 and I noticed today that in files where I
import "C"
and#include
a.h
file, the exported class of lints (doc comments on exported function etc.) don't show up.These lints work prefectly fine if I don't
import "C"
.The lints also work fine if I enable the now deprecated
golint
linter even without removingimport "C"
, so this is just a problem withrevive
, for some reason.Version of golangci-lint
Configuration file
Go environment
Verbose output of running
Without
import "C"
:With
import "C"
:Code example or link to a public repository
The minimum project I set up is a
.golangci.json
file with the above config, ago.mod
file, amain.go
file with an emptymain
function in it, and then ansdl
package.The
sdl
package contains a singlesdl.go
file with the following contents:As soon as I remove the
import "C"
golangci-lint correctly reports the missing doc comments.The text was updated successfully, but these errors were encountered: