From 0de933be1d923acedb82e567086dc4736d521f8b Mon Sep 17 00:00:00 2001 From: Travis Bischel Date: Thu, 10 Oct 2024 16:54:53 -0600 Subject: [PATCH] all: unlint what is now cropping up gosec ones are delibate; govet ones are now randomly showing up (and also deliberate) --- .golangci.yml | 3 ++- generate/gen.go | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 2895cca6..193366c2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -24,9 +24,9 @@ linters: - asciicheck - bidichk - bodyclose + - copyloopvar - durationcheck - exhaustive - - exportloopref - gocritic - gofmt - gofumpt @@ -74,6 +74,7 @@ linters-settings: excludes: - G104 # unhandled errors, we exclude for the same reason we do not use errcheck - G404 # we want math/rand + - G115 # irrelevant flags in this repo # Gocritic is a meta linter that has very good lints, and most of the # experimental ones are very good too. We opt into everything, which helps diff --git a/generate/gen.go b/generate/gen.go index fec90d1c..4f7cf8e3 100644 --- a/generate/gen.go +++ b/generate/gen.go @@ -625,7 +625,7 @@ func (s Struct) WriteDefault(l *LineWriter) { func (s Struct) WriteDefn(l *LineWriter) { if s.Comment != "" { - l.Write(s.Comment) + l.Write(s.Comment) //nolint:govet // ... } l.Write("type %s struct {", s.Name) if s.TopLevel { @@ -822,7 +822,7 @@ func (s Struct) WriteNewPtrFunc(l *LineWriter) { func (e Enum) WriteDefn(l *LineWriter) { if e.Comment != "" { - l.Write(e.Comment) + l.Write(e.Comment) //nolint:govet // ... l.Write("// ") } l.Write("// Possible values and their meanings:") @@ -830,7 +830,7 @@ func (e Enum) WriteDefn(l *LineWriter) { for _, v := range e.Values { l.Write("// * %d (%s)", v.Value, v.Word) if len(v.Comment) > 0 { - l.Write(v.Comment) + l.Write(v.Comment) //nolint:govet // ... } l.Write("//") }