Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions cmd/cli/commands/configure_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,37 @@
"fmt"

"github.com/docker/model-runner/cmd/cli/commands/completion"

Check failure on line 8 in cmd/cli/commands/configure_show.go

View workflow job for this annotation

GitHub Actions / lint (linux)

File is not properly formatted (gci)
"github.com/spf13/cobra"
)

func newConfigureShowCmd() *cobra.Command {
c := &cobra.Command{
Use: "show [MODEL]",
Short: "Show model configurations",
Short: "Show effective runtime configuration for models",
Long: "Show the effective runtime configuration that Docker Model Runner has stored for one model or all models.",
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
var modelFilter string
if len(args) > 0 {
modelFilter = args[0]
}

configs, err := desktopClient.ShowConfigs(modelFilter)
if err != nil {
return err
}
jsonResult, err := json.MarshalIndent(configs, "", " ")

jsonResult, err := json.MarshalIndent(configs, "", " ")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The JSON indentation has been reduced from two spaces to one space. This makes the command output harder to read and appears to be an accidental change as it is not mentioned in the PR description. Reverting to two spaces ensures the output remains user-friendly and consistent with standard formatting.

Suggested change
jsonResult, err := json.MarshalIndent(configs, "", " ")
jsonResult, err := json.MarshalIndent(configs, "", " ")
References
  1. User empathy — How does this affect the people who use, operate, and maintain this system? Consider developer ergonomics, operational burden, error messages, failure modes, and the debugging experience. (link)

if err != nil {
return fmt.Errorf("failed to marshal configs to JSON: %w", err)
}

cmd.Println(string(jsonResult))
return nil
},
ValidArgsFunction: completion.ModelNames(getDesktopClient, 1),
}

return c
}
Loading