Skip to content

Commit

Permalink
Exclude Analyzer from globals check
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Eikemeier <[email protected]>
  • Loading branch information
eikemeier committed Feb 10, 2025
1 parent 298450d commit 499268c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ issues:
linters:
- gocheckcompilerdirectives
text: "go:debug"
- path: ^pkg/analyzer/analyzer\.go$
linters:
- gochecknoglobals
- linters:
- govet
text: '^shadow: declaration of "(ctx|err|ok)" shadows declaration at line \d+$'
10 changes: 5 additions & 5 deletions pkg/analyzer/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Pointer to zero-length variables carry very little information and
can often be avoided.`
)

var Analyzer = &analysis.Analyzer{ //nolint:gochecknoglobals
var Analyzer = &analysis.Analyzer{
Name: Name,
Doc: Doc,
URL: "https://pkg.go.dev/fillmore-labs.com/zerolint/pkg/analyzer",
Expand All @@ -47,16 +47,16 @@ func init() { //nolint:gochecknoinits

var (
// Excludes is a list of types to exclude from the analysis.
Excludes string //nolint:gochecknoglobals
Excludes string

// ZeroTrace enables tracing of found zero-sized types.
ZeroTrace bool //nolint:gochecknoglobals
ZeroTrace bool

// Basic enables basic analysis only.
Basic bool //nolint:gochecknoglobals
Basic bool

// Generated enables checking generated files.
Generated bool //nolint:gochecknoglobals
Generated bool
)

// run applies the analyzer to a package.
Expand Down

0 comments on commit 499268c

Please sign in to comment.