Skip to content

Commit b304921

Browse files
authored
chore: Expanding lll coverage to errorconfig (#5856)
1 parent a95dadc commit b304921

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ linters:
114114
# trying to get this merged in.
115115
- linters:
116116
- lll
117-
path-except: '^(internal/awshelper/|internal/cas/|internal/cli/commands/(backend/(delete|migrate)|catalog/tui/command|exec|find|help|list|stack)/|internal/cloner/|internal/configbridge/|internal/engine/|internal/errors/|internal/gcphelper/|internal/git/|internal/prepare/|internal/runner/(common|graph|run/creds/providers/amazonsts)/|internal/stacks/(generate|output)/|internal/tf/cache/middleware/|internal/tips/|pkg/log/(format/placeholders|writer)/)'
117+
path-except: '^(internal/awshelper/|internal/cas/|internal/cli/commands/(backend/(delete|migrate)|catalog/tui/command|exec|find|help|list|stack)/|internal/cloner/|internal/configbridge/|internal/engine/|internal/errorconfig/|internal/errors/|internal/gcphelper/|internal/git/|internal/prepare/|internal/runner/(common|graph|run/creds/providers/amazonsts)/|internal/stacks/(generate|output)/|internal/tf/cache/middleware/|internal/tips/|pkg/log/(format/placeholders|writer)/)'
118118
paths:
119119
- docs
120120
- _ci

internal/errorconfig/types_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ func TestExtractErrorMessage_DoesNotFalselyMatchTimeout(t *testing.T) {
6363
// The timeout pattern should NOT match because the extracted message only
6464
// contains stderr and exit error, not the command flags.
6565
matched := errorconfig.MatchesAnyRegexpPattern(msg, patterns)
66-
assert.False(t, matched, "timeout pattern should NOT match when 'timeout' only appears in command flags; cleaned message: %s", msg)
66+
assert.False(t, matched,
67+
"timeout pattern should NOT match when 'timeout' only appears in command flags; cleaned message: %s", msg)
6768
}
6869

6970
func TestExtractErrorMessage_StillMatchesRealTimeout(t *testing.T) {
@@ -88,7 +89,8 @@ func TestExtractErrorMessage_StillMatchesRealTimeout(t *testing.T) {
8889

8990
msg := errorconfig.ExtractErrorMessage(err)
9091
matched := errorconfig.MatchesAnyRegexpPattern(msg, patterns)
91-
assert.True(t, matched, "timeout pattern should match when stderr actually contains 'timeout'; cleaned message: %s", msg)
92+
assert.True(t, matched,
93+
"timeout pattern should match when stderr actually contains 'timeout'; cleaned message: %s", msg)
9294
}
9395

9496
func TestExtractErrorMessage_StillMatchesTimeoutInStderrWithFlags(t *testing.T) {
@@ -114,7 +116,8 @@ func TestExtractErrorMessage_StillMatchesTimeoutInStderrWithFlags(t *testing.T)
114116

115117
msg := errorconfig.ExtractErrorMessage(err)
116118
matched := errorconfig.MatchesAnyRegexpPattern(msg, patterns)
117-
assert.True(t, matched, "timeout pattern should match when stderr actually contains 'timeout'; cleaned message: %s", msg)
119+
assert.True(t, matched,
120+
"timeout pattern should match when stderr actually contains 'timeout'; cleaned message: %s", msg)
118121
}
119122

120123
func TestExtractErrorMessage_NonProcessError(t *testing.T) {

0 commit comments

Comments
 (0)