From 415a738c40f50f424a39fe564915556080011b44 Mon Sep 17 00:00:00 2001 From: Devon Stewart Date: Fri, 31 May 2024 09:57:10 -0700 Subject: [PATCH 1/3] lll: Advertise max line length instead of just reporting failure --- pkg/golinters/lll/lll.go | 2 +- test/run_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/golinters/lll/lll.go b/pkg/golinters/lll/lll.go index 15edcccad4a4..7618091eb7d8 100644 --- a/pkg/golinters/lll/lll.go +++ b/pkg/golinters/lll/lll.go @@ -121,7 +121,7 @@ func getLLLIssuesForFile(filename string, maxLineLen int, tabSpaces string) ([]r Filename: filename, Line: lineNumber, }, - Text: fmt.Sprintf("line is %d characters", lineLen), + Text: fmt.Sprintf("line is %d characters, max %d", lineLen, maxLineLen), FromLinter: linterName, }) } diff --git a/test/run_test.go b/test/run_test.go index 9040f0ffd322..d930acbec5f2 100644 --- a/test/run_test.go +++ b/test/run_test.go @@ -218,7 +218,7 @@ func TestLineDirective(t *testing.T) { }, configPath: "testdata/linedirective/lll.yml", targetPath: "linedirective", - expected: "line is 57 characters (lll)", + expected: "line is 57 characters, max 50 (lll)", }, { desc: "misspell", From a6b9d8204df22d0c9923c9f6d7f66c5450fd7754 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Fri, 31 May 2024 21:43:09 +0200 Subject: [PATCH 2/3] review: rephrase --- pkg/golinters/lll/lll.go | 2 +- test/run_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/golinters/lll/lll.go b/pkg/golinters/lll/lll.go index 7618091eb7d8..f4a12519d991 100644 --- a/pkg/golinters/lll/lll.go +++ b/pkg/golinters/lll/lll.go @@ -121,7 +121,7 @@ func getLLLIssuesForFile(filename string, maxLineLen int, tabSpaces string) ([]r Filename: filename, Line: lineNumber, }, - Text: fmt.Sprintf("line is %d characters, max %d", lineLen, maxLineLen), + Text: fmt.Sprintf("The line is %d characters long, which exceeds the maximum of %d characters.", lineLen, maxLineLen), FromLinter: linterName, }) } diff --git a/test/run_test.go b/test/run_test.go index d930acbec5f2..5f33508acb1d 100644 --- a/test/run_test.go +++ b/test/run_test.go @@ -218,7 +218,7 @@ func TestLineDirective(t *testing.T) { }, configPath: "testdata/linedirective/lll.yml", targetPath: "linedirective", - expected: "line is 57 characters, max 50 (lll)", + expected: "The line is 57 characters long, which exceeds the maximum of 50 characters. (lll)", }, { desc: "misspell", From 4cfa367878863cf485c0312d653c79f3f38cc658 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sat, 1 Jun 2024 15:13:16 +0200 Subject: [PATCH 3/3] review: remove first letter uppercase --- pkg/golinters/lll/lll.go | 2 +- test/run_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/golinters/lll/lll.go b/pkg/golinters/lll/lll.go index f4a12519d991..67f89eecbdd6 100644 --- a/pkg/golinters/lll/lll.go +++ b/pkg/golinters/lll/lll.go @@ -121,7 +121,7 @@ func getLLLIssuesForFile(filename string, maxLineLen int, tabSpaces string) ([]r Filename: filename, Line: lineNumber, }, - Text: fmt.Sprintf("The line is %d characters long, which exceeds the maximum of %d characters.", lineLen, maxLineLen), + Text: fmt.Sprintf("the line is %d characters long, which exceeds the maximum of %d characters.", lineLen, maxLineLen), FromLinter: linterName, }) } diff --git a/test/run_test.go b/test/run_test.go index 5f33508acb1d..ed99473b8e95 100644 --- a/test/run_test.go +++ b/test/run_test.go @@ -218,7 +218,7 @@ func TestLineDirective(t *testing.T) { }, configPath: "testdata/linedirective/lll.yml", targetPath: "linedirective", - expected: "The line is 57 characters long, which exceeds the maximum of 50 characters. (lll)", + expected: "the line is 57 characters long, which exceeds the maximum of 50 characters. (lll)", }, { desc: "misspell",