Skip to content

Commit

Permalink
Remove konk structs from exhaustruct exemptions
Browse files Browse the repository at this point in the history
  • Loading branch information
jclem committed Dec 24, 2024
1 parent e253035 commit 9f0bd47
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
5 changes: 0 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ linters-settings:

exhaustruct:
exclude:
- "^github.com/jclem/konk/konk.Command$"
- "^github.com/jclem/konk/konk.CommandConfig$"
- "^github.com/jclem/konk/konk.RunCommandConfig$"
- "^github.com/jclem/konk/konk.ShellCommandConfig$"
- "^github.com/jclem/konk/konk.RunConcurrentlyConfig$"
- "^github.com/spf13/cobra.Command$"

funlen:
Expand Down
2 changes: 2 additions & 0 deletions cmd/concurrently.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ var cCommand = cobra.Command{
commands, err := konk.RunConcurrently(cmd.Context(), konk.RunConcurrentlyConfig{
Commands: cmdParts,
Labels: labels,
Env: make([]string, 0),
OmitEnv: false,
AggregateOutput: aggregateOutput,
ContinueOnError: continueOnError,
NoColor: noColor,
Expand Down
3 changes: 2 additions & 1 deletion cmd/proc.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ var procCommand = cobra.Command{
commands, err := konk.RunConcurrently(cmd.Context(), konk.RunConcurrentlyConfig{
Commands: commandStrings,
Labels: commandLabels,
ContinueOnError: continueOnError,
Env: envLines,
OmitEnv: omitEnv,
AggregateOutput: false,
ContinueOnError: continueOnError,
NoColor: noColor,
NoShell: noShell,
})
Expand Down
9 changes: 8 additions & 1 deletion cmd/serially.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,16 @@ var sCommand = cobra.Command{
Args: parts[1:],
Label: labels[i],
NoColor: noColor,
Env: make([]string, 0),
OmitEnv: false,
})
} else {
c = konk.NewShellCommand(konk.ShellCommandConfig{
Command: cmd,
Label: labels[i],
NoColor: noColor,
Env: make([]string, 0),
OmitEnv: false,
})
}

Expand All @@ -74,7 +78,10 @@ var sCommand = cobra.Command{
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

if err := c.Run(ctx, cancel, konk.RunCommandConfig{}); err != nil && continueOnError {
if err := c.Run(ctx, cancel, konk.RunCommandConfig{
AggregateOutput: false,
StopOnCancel: false,
}); err != nil && continueOnError {
errCmd = err
} else if err != nil {
return fmt.Errorf("running command: %w", err)
Expand Down
2 changes: 2 additions & 0 deletions konk/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func NewShellCommand(conf ShellCommandConfig) *Command {

return &Command{
cmd: c,
out: strings.Builder{},
prefix: prefix,
}
}
Expand Down Expand Up @@ -69,6 +70,7 @@ func NewCommand(conf CommandConfig) *Command {

return &Command{
cmd: cmd,
out: strings.Builder{},
prefix: prefix,
}
}
Expand Down

0 comments on commit 9f0bd47

Please sign in to comment.