Skip to content

Commit a890bf7

Browse files
authored
chore: Expanding lll coverage to list (#5855)
1 parent 4085dd3 commit a890bf7

4 files changed

Lines changed: 13 additions & 5 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)/|internal/cli/commands/catalog/tui/command/|internal/cli/commands/exec/|internal/cli/commands/find/|internal/cli/commands/help/|internal/cli/commands/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/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/cli/commands/list/cli.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ func NewFlags(l log.Logger, opts *Options, prefix flags.Prefix) clihelper.Flags
8282
flags.NewFlag(&clihelper.BoolFlag{
8383
Name: ExternalFlagName,
8484
EnvVars: tgPrefix.EnvVars(ExternalFlagName),
85-
Usage: "Discover external dependencies from initial results, and add them to top-level results (implies discovery of dependencies).",
86-
Hidden: true,
85+
Usage: "Discover external dependencies from initial results," +
86+
" and add them to top-level results (implies discovery of dependencies).",
87+
Hidden: true,
8788
Action: func(_ context.Context, _ *clihelper.Context, value bool) error {
8889
if !value {
8990
return nil

internal/cli/commands/list/list.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ func Run(ctx context.Context, l log.Logger, opts *Options) error {
4141
// so that we can defer cleanup in the same context.
4242
gitFilters := opts.Filters.UniqueGitFilters()
4343

44-
worktrees, worktreeErr := worktrees.NewWorktrees(ctx, l, worktrees.WorktreeOpts{WorkingDir: opts.WorkingDir, GitExpressions: gitFilters, Experiments: opts.Experiments})
44+
worktrees, worktreeErr := worktrees.NewWorktrees(ctx, l, worktrees.WorktreeOpts{
45+
WorkingDir: opts.WorkingDir,
46+
GitExpressions: gitFilters,
47+
Experiments: opts.Experiments,
48+
})
4549
if worktreeErr != nil {
4650
return errors.Errorf("failed to create worktrees: %w", worktreeErr)
4751
}

internal/cli/commands/list/list_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ func TestHiddenDiscovery(t *testing.T) {
131131
require.NoError(t, err)
132132
}
133133

134-
expectedPaths := []string{"unit1", "unit2", filepath.Join("nested", "unit4"), "stack1", filepath.Join(".hidden", "unit3")}
134+
expectedPaths := []string{
135+
"unit1", "unit2", filepath.Join("nested", "unit4"),
136+
"stack1", filepath.Join(".hidden", "unit3"),
137+
}
135138

136139
tgOpts := options.NewTerragruntOptions()
137140
tgOpts.WorkingDir = tmpDir

0 commit comments

Comments
 (0)