Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22.1

require (
4d63.com/gocheckcompilerdirectives v1.2.1
4d63.com/gochecknoglobals v0.2.1
4d63.com/gochecknoglobals v0.2.2
github.com/4meepo/tagalign v1.4.1
github.com/Abirdcfly/dupword v0.1.3
github.com/Antonboom/errname v1.0.0
Expand Down
9 changes: 2 additions & 7 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 1 addition & 8 deletions pkg/golinters/gochecknoglobals/gochecknoglobals.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,10 @@ import (
func New() *goanalysis.Linter {
a := checknoglobals.Analyzer()

// gochecknoglobals only lints test files if the `-t` flag is passed,
// so we pass the `t` flag as true to the analyzer before running it.
// This can be turned off by using the regular golangci-lint flags such as `--tests` or `--exclude-files`.
linterConfig := map[string]map[string]any{
a.Name: {"t": true},
}

return goanalysis.NewLinter(
a.Name,
"Check that no global variables exist.",
[]*analysis.Analyzer{a},
linterConfig,
nil,
).WithLoadMode(goanalysis.LoadModeTypesInfo)
}
Loading