Closed
Description
- Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
- Yes, I've searched similar issues on GitHub and didn't find any.
- Yes, I've included all information below (version, config, etc).
- Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)
Description of the problem
revive does not exclude some of the exported comment lint. but golint exclude same one.
Version of golangci-lint
$ golangci-lint --version
golangci-lint has version 1.40.1 built from 625445b1 on 2021-05-14T11:44:45Z
Config file
$ cat .golangci.yml
linters:
enable:
- revive
Go environment
$ go version && go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/taiki/.cache/go-build"
GOENV="/home/taiki/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/taiki/dev/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/taiki/dev"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.4"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/taiki/tmp/golangci-revive/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build350676579=/tmp/go-build -gno-record-gcc-switches"
Verbose output of running
$ golangci-lint cache clean
$ golangci-lint run -v
INFO [config_reader] Config search paths: [./ /home/taiki/tmp/golangci-revive /home/taiki/tmp /home/taiki /home /]
INFO [config_reader] Used config file .golangci.yml
INFO [lintersdb] Active 11 linters: [deadcode errcheck gosimple govet ineffassign revive staticcheck structcheck typecheck unused varcheck]
INFO [loader] Go packages loading at mode 575 (exports_file|files|types_sizes|compiled_files|deps|imports|name) took 76.539641ms
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 113.41µs
INFO [linters context/goanalysis] analyzers took 8.137345ms with top 10 stages: the_only_name: 3.743804ms, nilness: 1.860044ms, fact_deprecated: 326.681µs, buildir: 274.052µs, typedness: 223.17µs, ctrlflow: 150.564µs, SA5012: 143.803µs, printf: 142.874µs, fact_purity: 132.593µs, unused: 94.732µs
INFO [runner] Processors filtering stat (out/in): path_prettifier: 2/2, autogenerated_exclude: 2/2, nolint: 2/2, max_from_linter: 2/2, path_prefixer: 2/2, skip_dirs: 2/2, exclude: 2/2, diff: 2/2, max_per_file_from_linter: 2/2, max_same_issues: 2/2, source_code: 2/2, path_shortener: 2/2, severity-rules: 2/2, filename_unadjuster: 2/2, cgo: 2/2, skip_files: 2/2, identifier_marker: 2/2, exclude-rules: 2/2, uniq_by_line: 2/2, sort_results: 2/2
INFO [runner] processing took 397.27µs with stages: exclude-rules: 150.264µs, identifier_marker: 98.618µs, nolint: 42.631µs, autogenerated_exclude: 30.98µs, path_prettifier: 26.047µs, source_code: 21.688µs, skip_dirs: 11.265µs, max_same_issues: 3.73µs, uniq_by_line: 3.101µs, cgo: 1.91µs, path_shortener: 1.48µs, max_from_linter: 1.446µs, filename_unadjuster: 1.407µs, max_per_file_from_linter: 762ns, skip_files: 383ns, exclude: 351ns, path_prefixer: 318ns, diff: 310ns, severity-rules: 299ns, sort_results: 280ns
INFO [runner] linters took 22.77286ms with stages: goanalysis_metalinter: 21.742262ms
a.go:4:2: exported: exported const C should have comment (or a comment on this block) or be unexported (revive)
C = "x"
^
a.go:7:1: exported: comment on exported function F should be of the form "F ..." (revive)
// a function
^
INFO File cache stats: 1 entries of total size 83B
INFO Memory: 3 samples, avg is 71.2MB, max is 71.3MB
INFO Execution took 120.633263ms
Code example or link to a public repository
package example
const (
C = "x"
)
// a function
func F() string {
return "F"
}
It looks like the default exlude rule doesn't cover some cases.