Skip to content
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

periodically seen issue where lint failures are not reported #4872

Closed
6 of 7 tasks
stan-stately opened this issue Jul 16, 2024 · 4 comments
Closed
6 of 7 tasks

periodically seen issue where lint failures are not reported #4872

stan-stately opened this issue Jul 16, 2024 · 4 comments
Labels
question Further information is requested

Comments

@stan-stately
Copy link

Welcome

  • Yes, I'm using a binary release within 2 latest releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've read the typecheck section of the FAQ.
  • Yes, I've tried with the standalone linter if available (e.g., gocritic, go vet, etc.).
  • I agree to follow this project's Code of Conduct

Description of the problem

I've periodically seen issue where lint failures are not reported by golangci-lint. In these cases I have run a golangci-lint cache clean which caused the linter to start reporting the failures correctly again. This is concerning because the issue happened in my CI and I had linting failures make it into my main branch.

Version of golangci-lint

$ golangci-lint --version
# golangci-lint has version v1.59.1 built with go1.22.3 from (unknown, modified: ?, mod sum: "h1:CRRLu1JbhK5avLABFJ/OHVSQ0Ie5c4ulsOId1h3TTks=") on (unknown)

Configuration

run:
  timeout: 5m
  tests: true
  modules-download-mode: readonly
  allow-parallel-runners: true
  go: ""
output:
  sort-results: true
linters:
  enable:
    - errcheck
    - gosimple
    - govet
    - ineffassign
    - staticcheck
    - unused
    - asasalint
    - bodyclose
    - depguard
    - durationcheck
    - errname
    - exportloopref
    - gocheckcompilerdirectives
    - gocritic
    - godot
    - gofumpt
    - gofmt
    - goprintffuncname
    - gosec
    - importas
    - misspell
    - nakedret
    - noctx
    - prealloc
    - predeclared
    - reassign
    - revive
    - stylecheck
    - unconvert
    - unparam
    - usestdlibvars
    - wastedassign
    - gci
    - forbidigo

Go environment

$ go version && go env
go version go1.22.5 darwin/arm64
GO111MODULE=''
GOARCH='arm64'
GOBIN='<redacted>/.local/share/mise/installs/go/1.22.3/bin'
GOCACHE='<redacted>/Library/Caches/go-build'
GOENV='<redacted>/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='<redacted>/go/pkg/mod'
GONOPROXY='<redacted>'
GONOSUMDB='<redacted>'
GOOS='darwin'
GOPATH='<redacted>/go'
GOPRIVATE='<redacted>'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='<redacted>/go/pkg/mod/golang.org/[email protected]'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='<redacted>/go/pkg/mod/golang.org/[email protected]/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.5'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK='<redacted>/go.work'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/r3/pl_y4pgx031f53mt59y7kvmc0000gp/T/go-build320513934=/tmp/go-build -gno-record-gcc-switches -fno-common'

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
INFO golangci-lint has version v1.59.1 built with go1.22.3 from (unknown, modified: ?, mod sum: "h1:CRRLu1JbhK5avLABFJ/OHVSQ0Ie5c4ulsOId1h3TTks=") on (unknown)
INFO [config_reader] Config search paths: [./ /<redacted> <redacted> <redacted> <redacted> <redacted> /]
INFO [config_reader] Used config file ../.golangci.yaml
INFO [lintersdb] Active 34 linters: [asasalint bodyclose depguard durationcheck errcheck errname exportloopref forbidigo gci gocheckcompilerdirectives gocritic godot gofmt gofumpt goprintffuncname gosec gosimple govet importas ineffassign misspell nakedret noctx prealloc predeclared reassign revive staticcheck stylecheck unconvert unparam unused usestdlibvars wastedassign]
INFO [loader] Go packages loading at mode 575 (types_sizes|exports_file|files|imports|name|compiled_files|deps) took 719.611084ms
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 13.772917ms
INFO [linters_context/goanalysis] analyzers took 3m6.670504804s with top 10 stages: gocritic: 1m10.60199246s, buildir: 41.007719425s, wastedassign: 9.951228455s, the_only_name: 7.039918085s, fact_deprecated: 3.02030044s, unconvert: 2.554245163s, printf: 2.192414565s, ctrlflow: 2.135914632s, inspect: 2.124014716s, buildssa: 1.844337131s
INFO [runner] Issues before processing: 710, after processing: 0
INFO [runner] Processors filtering stat (out/in): identifier_marker: 223/223, filename_unadjuster: 710/710, skip_files: 710/710, skip_dirs: 710/710, autogenerated_exclude: 223/710, exclude: 223/223, exclude-rules: 26/223, nolint: 0/26, cgo: 710/710, invalid_issue: 710/710, path_prettifier: 710/710
INFO [runner] processing took 21.727873ms with stages: autogenerated_exclude: 9.083542ms, nolint: 4.248375ms, exclude-rules: 3.247667ms, path_prettifier: 2.470333ms, identifier_marker: 2.129833ms, skip_dirs: 420.958µs, invalid_issue: 62.083µs, cgo: 40.292µs, filename_unadjuster: 18.583µs, diff: 2.334µs, sort_results: 1.084µs, skip_files: 1.083µs, uniq_by_line: 375ns, max_same_issues: 333ns, fixer: 292ns, source_code: 249ns, exclude: 208ns, max_from_linter: 124ns, max_per_file_from_linter: 83ns, severity-rules: 42ns, path_shortener: 0s, path_prefixer: 0s
INFO [runner] linters took 17.5195085s with stages: goanalysis_metalinter: 17.49770675s
INFO File cache stats: 260 entries of total size 1.8MiB
INFO Memory: 184 samples, avg is 1744.3MB, max is 3077.1MB
INFO Execution took 18.264405083s

A minimal reproducible example or link to a public repository

I haven't been able to reliably reproduce this. its a transient issue

Validation

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

Supporter

@stan-stately stan-stately added the bug Something isn't working label Jul 16, 2024
Copy link

boring-cyborg bot commented Jul 16, 2024

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

@ldez ldez added the feedback required Requires additional feedback label Jul 16, 2024
@ldez
Copy link
Member

ldez commented Jul 16, 2024

Hello,

without something to reproduce, it's impossible to diagnose the problem.

It can be related to the same problem as #4423, but one again without something to reproduce, it's impossible to know.

@ldez ldez changed the title Invalid cache causes lint failures to be missed periodically seen issue where lint failures are not reported Jul 16, 2024
@stan-stately
Copy link
Author

give me an hr to try and repro

@stan-stately
Copy link
Author

its not you. vscode is installing @latest which is competing with my mise installed shim. @latest has a new rule which is causing the failure

@ldez ldez added question Further information is requested and removed bug Something isn't working feedback required Requires additional feedback labels Jul 16, 2024
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