-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
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
typechecksection 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
Myself and others on my team have run golangci-lint with issues.exclude-files, issues.exclude-dirs, issues.exclude, issues.exclude-rules, and many other configurations with the generated files path addressed, but the gen/ folder is still being linted and failing, even though the files within them are currently standalone.
From my read of the docs, these files should be skipped with the default exclude-generated tag being lax and with // Code generated by protoc-gen-connect-go. DO NOT EDIT. at the top of the file.
Nonetheless, the files are not being skipped and yielding the outputs below.
This problem did not exist on an instance of v1.54.
Version of golangci-lint
$ golangci-lint --version
golangci-lint has version 1.61.0 built with go1.23.1 from a1d6c56 on 2024-09-09T14:33:19ZConfiguration
linters:
enable:
- goimports
- revive
- misspell
- unconvert
- whitespace
- dupword
- gofumpt
- gocritic
- gocyclo
linters-settings:
gocyclo:
# Minimal code complexity to report.
# Default: 30 (but we recommend 10-20)
min-complexity: 15
revive:
ignore-generated-header: true
severity: warning
confidence: 0.8
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: if-return
- name: increment-decrement
- name: var-declaration
- name: range
- name: exported
- name: package-comments
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: indent-error-flow
- name: errorf
issues:
exclude-rules:
- path: gen/
linters:
- blank-imports
- context-as-argument
- context-keys-type
- dot-imports
- error-return
- error-strings
- error-naming
- if-return
- increment-decrement
- var-declaration
- range
- exported
- package-comments
- receiver-naming
- time-naming
- unexported-return
- indent-error-flow
- errorf
exclude-dirs:
- "gen/" # gen, gen/, gen/*, "gen", "gen/", "gen/*", etc. have been tried
exclude-generated: lax
exclude-files:
- "gen/path/to/file/service1.connect.go"Go environment
$ go version && go env
go version go1.23.2 darwin/arm64
GO111MODULE='on'
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/user/Library/Caches/go-build'
GOENV='/Users/user/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/user/go/pkg/mod'
GONOPROXY='github.com/repo,buf.corp.com/gen/go'
GONOSUMDB='github.com/repo,buf.corp.com/gen/go'
GOOS='darwin'
GOPATH='/Users/user/go'
GOPRIVATE='github.com/corp,buf.corp.com/gen/go'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/opt/go/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/opt/homebrew/opt/go/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.23.2'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/user/Library/Application Support/go/telemetry'
GCCGO='gccgo'
GOARM64='v8.0'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/Users/user/Github/repo/go.mod'
GOWORK=''
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/xxxxxx/xxxxx/T/go-build2678619271=/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 1.61.0 built with go1.23.1 from a1d6c56 on 2024-09-09T14:33:19Z
INFO [config_reader] Config search paths: [./ /Users/user/Github/repo /Users/user/Github /Users/user /Users /]
INFO [config_reader] Used config file .golangci.yaml
INFO [lintersdb] Active 15 linters: [dupword errcheck gocritic gocyclo gofumpt goimports gosimple govet ineffassign misspell revive staticcheck unconvert unused whitespace]
INFO [loader] Go packages loading at mode 575 (types_sizes|files|imports|name|compiled_files|deps|exports_file) took 888.641458ms
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 3.461958ms
INFO [linters_context/goanalysis] analyzers took 28.573670851s with top 10 stages: buildir: 18.189186354s, fact_deprecated: 1.416911961s, printf: 1.276906088s, ctrlflow: 1.276653003s, inspect: 1.047814265s, the_only_name: 927.155418ms, fact_purity: 905.355871ms, nilness: 898.449256ms, typedness: 863.987624ms, SA5012: 782.061446ms
INFO [runner] Issues before processing: 344, after processing: 1
INFO [runner] Processors filtering stat (in/out): path_prettifier: 184/184, diff: 1/1, fixer: 1/1, path_prefixer: 1/1, cgo: 344/344, filename_unadjuster: 344/344, max_per_file_from_linter: 1/1, max_same_issues: 1/1, path_shortener: 1/1, severity-rules: 1/1, autogenerated_exclude: 184/184, exclude-rules: 184/184, max_from_linter: 1/1, sort_results: 1/1, identifier_marker: 184/184, uniq_by_line: 184/1, skip_dirs: 184/184, exclude: 184/184, nolint: 184/184, source_code: 1/1, invalid_issue: 344/184, skip_files: 184/184
INFO [runner] processing took 17.175252ms with stages: identifier_marker: 16.729583ms, source_code: 291.292µs, path_prettifier: 80.458µs, filename_unadjuster: 14.084µs, cgo: 13.667µs, invalid_issue: 8.791µs, skip_files: 5.625µs, nolint: 5.459µs, uniq_by_line: 5.25µs, skip_dirs: 5.209µs, autogenerated_exclude: 4.834µs, exclude-rules: 4.375µs, path_shortener: 4.208µs, max_same_issues: 1.125µs, max_from_linter: 291ns, fixer: 250ns, max_per_file_from_linter: 208ns, diff: 167ns, sort_results: 126ns, exclude: 125ns, path_prefixer: 84ns, severity-rules: 41ns
INFO [runner] linters took 6.86451225s with stages: goanalysis_metalinter: 6.84728475s
gen/folder/folder1/folder2/v1/v1connect/service1.connect.go:1: : # github.com/corp/repo/gen/folder/folder1/folder2/v1/v1connect
gen/folder/folder1/folder2/v1/v1connect/service2.connect.go:63:53: undefined: v1.CreateRequest
gen/folder/folder1/folder2/v1/v1connect/service2.connect.go:63:98: undefined: v1.CreateResponse
gen/folder/folder1/folder2/v1/v1connect/service2.connect.go:65:54: undefined: v1.ConfirmRequest
gen/folder/folder1/folder2/v1/v1connect/service2.connect.go:65:100: undefined: v1.ConfirmResponse
gen/folder/folder1/folder2/v1/v1connect/service2.connect.go:67:53: undefined: v1.UpdateRequest
gen/folder/folder1/folder2/v1/v1connect/service2.connect.go:67:98: undefined: v1.UpdateResponse
gen/folder/folder1/folder2/v1/v1connect/service2.connect.go:69:50: undefined: v1.GetRequest
gen/folder/folder1/folder2/v1/v1connect/service2.connect.go:69:92: undefined: v1.GetResponse
gen/folder/folder1/folder2/v1/v1connect/service2.connect.go:112:36: undefined: v1.CreateRequest
gen/folder/folder1/folder2/v1/v1connect/service2.connect.go:112:61: undefined: v1.CreateResponse
gen/folder/folder1/folder2/v1/v1connect/service2.connect.go:112:61: too many errors (typecheck)
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
INFO File cache stats: 10 entries of total size 73.2KiB
INFO Memory: 79 samples, avg is 1139.4MB, max is 1900.8MB
INFO Execution took 7.76389025s A minimal reproducible example or link to a public repository
Validation
- Yes, I've included all information above (version, config, etc.).
Supporter
- I am a sponsor/backer through GitHub or OpenCollective
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested