diff options
| -rw-r--r-- | .golangci.yml | 4 | ||||
| -rw-r--r-- | dashboard/app/bisect_test.go | 2 | ||||
| -rw-r--r-- | dashboard/app/config.go | 14 | ||||
| -rw-r--r-- | dashboard/app/reporting_email.go | 4 | ||||
| -rw-r--r-- | syz-manager/html.go | 2 | ||||
| -rw-r--r-- | tools/syz-check/check.go | 6 |
6 files changed, 18 insertions, 14 deletions
diff --git a/.golangci.yml b/.golangci.yml index 26341e86f..4b4b7248f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -12,6 +12,9 @@ run: build-tags: - codeanalysis +output: + print-linter-name: false + linters: enable: - lll @@ -55,6 +58,7 @@ linters-settings: issues: exclude-use-default: false + max-same-issues: 0 exclude: - "exported .* should have comment" - "comment on .* should be of the form" diff --git a/dashboard/app/bisect_test.go b/dashboard/app/bisect_test.go index cebb0b933..610811524 100644 --- a/dashboard/app/bisect_test.go +++ b/dashboard/app/bisect_test.go @@ -591,7 +591,7 @@ func TestBisectWrong(t *testing.T) { c.expectOK(c.client2.JobDone(done)) if i == 0 { msg := c.pollEmailBug() - c.expectTrue(strings.Contains(msg.Body, fmt.Sprintf("syzbot has bisected this bug to:"))) + c.expectTrue(strings.Contains(msg.Body, "syzbot has bisected this bug to:")) } else { c.expectNoEmail() } diff --git a/dashboard/app/config.go b/dashboard/app/config.go index cac0e9035..220adbb01 100644 --- a/dashboard/app/config.go +++ b/dashboard/app/config.go @@ -236,25 +236,25 @@ func checkConfig(cfg *GlobalConfig) { func checkObsoleting(o ObsoletingConfig) { if (o.MinPeriod == 0) != (o.MaxPeriod == 0) { - panic(fmt.Sprintf("obsoleting: both or none of Min/MaxPeriod must be specified")) + panic("obsoleting: both or none of Min/MaxPeriod must be specified") } if o.MinPeriod > o.MaxPeriod { - panic(fmt.Sprintf("obsoleting: Min > MaxPeriod")) + panic(fmt.Sprintf("obsoleting: Min > MaxPeriod (%v > %v)", o.MinPeriod, o.MaxPeriod)) } if o.MinPeriod != 0 && o.MinPeriod < 24*time.Hour { - panic(fmt.Sprintf("obsoleting: too low MinPeriod")) + panic(fmt.Sprintf("obsoleting: too low MinPeriod: %v, want at least %v", o.MinPeriod, 24*time.Hour)) } if (o.NonFinalMinPeriod == 0) != (o.NonFinalMaxPeriod == 0) { - panic(fmt.Sprintf("obsoleting: both or none of NonFinalMin/MaxPeriod must be specified")) + panic("obsoleting: both or none of NonFinalMin/MaxPeriod must be specified") } if o.NonFinalMinPeriod > o.NonFinalMaxPeriod { - panic(fmt.Sprintf("obsoleting: NonFinalMin > MaxPeriod")) + panic(fmt.Sprintf("obsoleting: NonFinalMin > MaxPeriod (%v > %v)", o.NonFinalMinPeriod, o.NonFinalMaxPeriod)) } if o.NonFinalMinPeriod != 0 && o.NonFinalMinPeriod < 24*time.Hour { - panic(fmt.Sprintf("obsoleting: too low MinPeriod")) + panic(fmt.Sprintf("obsoleting: too low MinPeriod: %v, want at least %v", o.NonFinalMinPeriod, 24*time.Hour)) } if o.MinPeriod == 0 && o.NonFinalMinPeriod != 0 { - panic(fmt.Sprintf("obsoleting: NonFinalMinPeriod without MinPeriod")) + panic("obsoleting: NonFinalMinPeriod without MinPeriod") } } diff --git a/dashboard/app/reporting_email.go b/dashboard/app/reporting_email.go index 494325dde..73c0e064b 100644 --- a/dashboard/app/reporting_email.go +++ b/dashboard/app/reporting_email.go @@ -308,12 +308,12 @@ func incomingMail(c context.Context, r *http.Request) error { case email.CmdNone, email.CmdUpstream, email.CmdInvalid, email.CmdUnDup: case email.CmdFix: if msg.CommandArgs == "" { - return replyTo(c, msg, fmt.Sprintf("no commit title"), nil) + return replyTo(c, msg, "no commit title", nil) } cmd.FixCommits = []string{msg.CommandArgs} case email.CmdDup: if msg.CommandArgs == "" { - return replyTo(c, msg, fmt.Sprintf("no dup title"), nil) + return replyTo(c, msg, "no dup title", nil) } cmd.DupOf = msg.CommandArgs case email.CmdUnCC: diff --git a/syz-manager/html.go b/syz-manager/html.go index b52f50f67..5538bf77e 100644 --- a/syz-manager/html.go +++ b/syz-manager/html.go @@ -165,7 +165,7 @@ func (mgr *Manager) httpCrash(w http.ResponseWriter, r *http.Request) { crashID := r.FormValue("id") crash := readCrash(mgr.cfg.Workdir, crashID, nil, mgr.startTime, true) if crash == nil { - http.Error(w, fmt.Sprintf("failed to read crash info"), http.StatusInternalServerError) + http.Error(w, "failed to read crash info", http.StatusInternalServerError) return } if err := crashTemplate.Execute(w, crash); err != nil { diff --git a/tools/syz-check/check.go b/tools/syz-check/check.go index a8d1a26de..060bad99b 100644 --- a/tools/syz-check/check.go +++ b/tools/syz-check/check.go @@ -646,15 +646,15 @@ func checkAttrType(typ *prog.StructDesc, payload prog.Type, policy nlaPolicy) st switch policy.typ { case NLA_STRING, NLA_NUL_STRING: if _, ok := payload.(*prog.BufferType); !ok { - return fmt.Sprintf("expect string") + return "expect string" } case NLA_NESTED: if typ.TemplateName() != "nlattr_tt" || typ.Fields[3].(*prog.ConstType).Val != 1 { - return fmt.Sprintf("should be nlnest") + return "should be nlnest" } case NLA_BITFIELD32: if typ.TemplateName() != "nlattr_t" || payload.TemplateName() != "nla_bitfield32" { - return fmt.Sprintf("should be nlattr[nla_bitfield32]") + return "should be nlattr[nla_bitfield32]" } case NLA_NESTED_ARRAY, NLA_REJECT: return fmt.Sprintf("unhandled type %v", policy.typ) |
