Skip to content

Commit 6285f7c

Browse files
committed
chore: Expanding lll coverage to format-options
1 parent be354f7 commit 6285f7c

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ linters:
121121
# trying to get this merged in.
122122
- linters:
123123
- lll
124-
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/experiment/|internal/gcphelper/|internal/git/|internal/os/exec/|internal/prepare/|internal/queue/|internal/runner/(common|graph|run/creds)/|internal/stacks/(generate|output)/|internal/tf/cache/(controllers|middleware)/|internal/tflint/|internal/tips/|internal/vfs/|internal/worktrees/|pkg/log/(format/placeholders|writer)/)'
124+
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/experiment/|internal/gcphelper/|internal/git/|internal/os/exec/|internal/prepare/|internal/queue/|internal/runner/(common|graph|run/creds)/|internal/stacks/(generate|output)/|internal/tf/cache/(controllers|middleware)/|internal/tflint/|internal/tips/|internal/vfs/|internal/worktrees/|pkg/log/(format/(options|placeholders)|writer)/)'
125125
paths:
126126
- docs
127127
- _ci

pkg/log/format/options/color.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ func Color(val ColorValue) Option {
190190
}
191191

192192
var (
193-
// defaultAutoColorValues contains ANSI color codes that are assigned sequentially to each unique text in a rotating order
193+
// defaultAutoColorValues contains ANSI color codes that are assigned
194+
// sequentially to each unique text in a rotating order
194195
// https://user-images.githubusercontent.com/995050/47952855-ecb12480-df75-11e8-89d4-ac26c50e80b9.png
195196
// https://www.hackitu.de/termcolor256/
196197
defaultAutoColorValues = []ColorValue{ //nolint:gochecknoglobals
@@ -211,7 +212,8 @@ var (
211212

212213
type gradientColor struct {
213214
// cache stores unique text with their color code.
214-
// We use [xsync.MapOf](https://github.com/puzpuzpuz/xsync?tab=readme-ov-file#map) instead of standard `sync.Map` since it's faster and has generic types.
215+
// We use [xsync.MapOf](https://github.com/puzpuzpuz/xsync?tab=readme-ov-file#map)
216+
// instead of standard `sync.Map` since it's faster and has generic types.
215217
cache *xsync.MapOf[string, ColorValue]
216218
values []ColorValue
217219
mu sync.Mutex

pkg/log/format/options/option.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ func (opts Options) Format(data *Data, str any) (string, error) {
106106

107107
// Configure parsers the given `str` to configure the `opts` and returns the rest of the given `str`.
108108
//
109-
// e.g. (color=green, case=upper) some-text" sets `color` option to `green`, `case` option to `upper` and returns " some-text".
109+
// e.g. (color=green, case=upper) some-text" sets `color` option to `green`,
110+
// `case` option to `upper` and returns " some-text".
110111
func (opts Options) Configure(str string) (string, error) {
111112
if len(str) == 0 || !strings.HasPrefix(str, OptStartSign) {
112113
return str, nil

pkg/log/format/options/path_format.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ func PathFormat(val PathFormatValue, allowed ...PathFormatValue) Option {
9797
}
9898

9999
// RelativePather replaces absolute paths with relative ones,
100-
// For better performance, during instance creation, we creating a cache of relative paths for each subdirectory of baseDir.
100+
// For better performance, during instance creation, we creating a cache
101+
// of relative paths for each subdirectory of baseDir.
101102
//
102103
// Example of cache:
103104
// /path/to/dir ./
@@ -133,7 +134,8 @@ func NewRelativePather(baseDir string) (*RelativePather, error) {
133134
reversIndex--
134135
relPaths[reversIndex] = relPath
135136

136-
regStr := fmt.Sprintf(`(^|[^%[1]s\w])%[2]s([%[1]s"'\s]|$)`, regexp.QuoteMeta(pathSeparator), regexp.QuoteMeta(absPath))
137+
regStr := fmt.Sprintf(`(^|[^%[1]s\w])%[2]s([%[1]s"'\s]|$)`,
138+
regexp.QuoteMeta(pathSeparator), regexp.QuoteMeta(absPath))
137139
absPathsReg[reversIndex] = regexp.MustCompile(regStr)
138140
}
139141

0 commit comments

Comments
 (0)