-
Notifications
You must be signed in to change notification settings - Fork 258
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
Switch from deprecated gometalinter to golangci/golangci-lint-action #975
Switch from deprecated gometalinter to golangci/golangci-lint-action #975
Conversation
f34537a
to
746baef
Compare
Man does it really not show the line numbers... |
Most of them can be figured out pretty easily just by symbols mentioned but some of them are awful. |
I'm not joking, this is the way it currently works! golangci/golangci-lint-action#119 suggests that errors would be visible in diff. But it is possible for errors to arise in the code that already exists due to code changes. And you can't see them anywhere. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, bummed about the line numbers issue though. We'll work on fixing those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slonopotamus Welp.. That's annoying. We'll chew away at fixing these then but the actual change looks fine to me.
Ah, yes, I've seen that on other repositories as well; really annoying
I have a feeling that's sometimes "random" (perhaps it works once it has a good "base" result, after which it can comment on new changes only, but it's a hassle if linters are updated and start producing errors on existing code) |
Alas, thought I'd give it a quick look, but I see it's not possible to run it on a Linux machine (some code may be missing a build-tag, causing it to be imported, but fail on Linux); $ docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.38.0 golangci-lint run -v
level=info msg="[config_reader] Config search paths: [./ /app / /root]"
level=info msg="[lintersdb] Active 10 linters: [deadcode errcheck gosimple govet ineffassign staticcheck structcheck typecheck unused varcheck]"
level=info msg="[loader] Go packages loading at mode 575 (compiled_files|deps|name|types_sizes|exports_file|files|imports) took 43.78349407s"
level=info msg="[runner/filename_unadjuster] Pre-built 0 adjustments in 312.323114ms"
level=info msg="[linters context/goanalysis] analyzers took 29.510010324s with top 10 stages: buildir: 19.047299839s, fact_deprecated: 2.455168594s, fact_purity: 1.693131699s, inspect: 1.269189209s, nilness: 575.496716ms, ctrlflow: 520.745104ms, printf: 477.085181ms, SA5012: 334.924374ms, typedness: 260.446627ms, isgenerated: 220.780037ms"
level=warning msg="[runner] Can't run linter goanalysis_metalinter: S1010: failed prerequisites: [(inspect@github.com/Microsoft/hcsshim/internal/interop, isgenerated@github.com/Microsoft/hcsshim/internal/interop): analysis skipped: errors in package: [/app/internal/interop/interop.go:13:17: UTF16ToString not declared by package syscall /app/internal/interop/interop.go:14:2: undeclared name: coTaskMemFree]]"
level=info msg="[linters context/goanalysis] analyzers took 2.486335783s with top 10 stages: buildir: 1.773297674s, isgenerated: 315.369011ms, unused: 303.664154ms, directives: 94.004944ms"
level=warning msg="[runner] Can't run linter unused: buildir: analysis skipped: errors in package: [/app/internal/interop/interop.go:13:17: UTF16ToString not declared by package syscall /app/internal/interop/interop.go:14:2: undeclared name: coTaskMemFree]"
level=info msg="[runner] processing took 4.172µs with stages: max_same_issues: 888ns, nolint: 633ns, skip_dirs: 435ns, skip_files: 308ns, cgo: 268ns, max_from_linter: 227ns, filename_unadjuster: 200ns, path_prettifier: 123ns, autogenerated_exclude: 120ns, uniq_by_line: 118ns, path_prefixer: 115ns, source_code: 113ns, identifier_marker: 112ns, exclude: 107ns, diff: 106ns, path_shortener: 104ns, max_per_file_from_linter: 55ns, sort_results: 51ns, severity-rules: 46ns, exclude-rules: 43ns"
level=info msg="[runner] linters took 13.97535622s with stages: goanalysis_metalinter: 12.568891682s, unused: 1.406346264s"
level=error msg="Running error: buildir: analysis skipped: errors in package: [/app/internal/interop/interop.go:13:17: UTF16ToString not declared by package syscall /app/internal/interop/interop.go:14:2: undeclared name: coTaskMemFree]"
level=info msg="Memory: 569 samples, avg is 127.7MB, max is 476.2MB"
level=info msg="Execution took 58.391537511s" |
@thaJeztah Are you sure the correct GOOS was set for building the package? I tried with the linux installation instructions here in wsl and it worked fine. |
@slonopotamus Forgot to mention, we were going to wait to fix up all of the linter issues before checking this in but you might have deduced that from these #976 #977. Thanks again |
Oh! Good one; I didn't try setting GOOS. Still wondering what's best; explicitly exclude files from
Ah, great 👍 |
746baef
to
736482a
Compare
@slonopotamus could you rebase this PR? |
736482a
to
2d2c19c
Compare
This PR updates our internal ADO repo to the github commit [d9474d2](microsoft@d9474d2). Related work items: microsoft#964, microsoft#965, microsoft#966, microsoft#967, microsoft#968, microsoft#969, microsoft#970, microsoft#971, microsoft#972, microsoft#974, microsoft#975, microsoft#976, microsoft#977, microsoft#978, microsoft#979, microsoft#980, microsoft#981, microsoft#982, microsoft#983, microsoft#984, microsoft#987, microsoft#990, microsoft#991, microsoft#992, microsoft#993, microsoft#995, microsoft#996, microsoft#997, microsoft#1000
Subj, as requested by @katiewasnothere.