WARN The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. WARN The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. INFO Go packages loading at mode 575 (files|name|exports_file|deps|imports|types_sizes|compiled_files) took 210.964208ms I then manually wrote some bad code that I knew staticcheck would fail on, and when running staticcheck directly it would report an issue (□□) but interestingly, when running golangci-lint directly, it again would still not report anything from staticcheck? But it would show part of an issue because of revive (which golangci-lint) is also configured to use. So why was Neovim reporting a staticcheck issue when configured via gopls but not via golangci-lint or directly via staticcheck? I then ran staticcheck directly and again no issues reported □ So I decided to run golangci-lint directly (as opposed to running it via Neovim) and it seems to think staticcheck is an active linter but didn't report any issues? So either there were no issues to report, which I don't believe because of the issue with the code as shown in my screenshot from earlier, or staticcheck just wasn't being run by golangci-lint. Next, I renabled staticcheck via golangci-lint (just to see if maybe any of the code comment solutions for ignoring the error would now suddenly work) but found that golangci-lint didn't seem to be running staticcheck at all. At this point I was sure that staticcheck wasn't running on my code at all, ok good □□ So I went and disabled staticcheck via my golangci-lint ~/.golangci.yml and found Neovim was still reporting the error! I then noticed I had staticcheck = true set in my gopls configuration and so I disabled that as well. If so then I guess that is possible to do as it looks like null-ls (which I also use) has a builtin for staticcheck So to clarify, your suggestion is to avoid using staticcheck via golangci-lint and to just use it directly, is that right? Hi did see your comment but I didn't quite understand it to be honest. INFO Memory: 9 samples, avg is 121.8MB, max is 136.7MB INFO File cache stats: 1 entries of total size 129B Be explicit if it isn't: time.Sleep(time.Nanosecond) (staticcheck) Main.go:10:13: SA1004: sleeping for 1 nanoseconds is probably a bug. INFO Processors filtering stat (out/in): filename_unadjuster: 1/1, autogenerated_exclude: 1/1, exclude-rules: 1/1, path_shortener: 1/1, cgo: 1/1, source_code: 1/1, path_prettifier: 1/1, uniq_by_line: 1/1, max_per_file_from_linter: 1/1, max_same_issues: 1/1, skip_dirs: 1/1, identifier_marker: 1/1, exclude: 1/1, nolint: 1/1, diff: 1/1, max_from_linter: 1/1, skip_files: 1/1 INFO worker.7 took 148.077µs with stages: ineffassign: 145.627µs INFO worker.5 took 40.529µs with stages: deadcode: 33.001µs INFO worker.3 took 94.53µs with stages: varcheck: 81.118µs, structcheck: 8.362µs INFO worker.8 took 21.127µs with stages: typecheck: 17.201µs INFO Go packages loading at mode 1023 (exports_file|files|imports|name|types|types_info|compiled_files|deps|syntax|types_sizes) took 724.109724ms INFO Optimized sublinters into metalinter megacheck
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |