MCPcopy Index your code
hub / github.com/github/gh-aw / renderBashCommandsDiffPrettySection

Function renderBashCommandsDiffPrettySection

pkg/cli/audit_diff_render.go:696–730  ·  view source on GitHub ↗

renderBashCommandsDiffPrettySection renders the bash commands breakdown as a pretty console sub-section.

(run1ID, run2ID int64, diff *BashCommandsDiff)

Source from the content-addressed store, hash-verified

694
695// renderBashCommandsDiffPrettySection renders the bash commands breakdown as a pretty console sub-section.
696func renderBashCommandsDiffPrettySection(run1ID, run2ID int64, diff *BashCommandsDiff) {
697 fmt.Fprintln(os.Stderr, console.FormatSectionHeader("Bash Commands"))
698 fmt.Fprintln(os.Stderr)
699
700 // Summary line
701 fmt.Fprintln(os.Stderr, console.FormatInfoMessage(
702 fmt.Sprintf("Total bash calls: Run #%d=%d, Run #%d=%d (%s)",
703 run1ID, diff.Run1TotalCalls,
704 run2ID, diff.Run2TotalCalls,
705 diff.TotalCallsChange),
706 ))
707
708 if len(diff.Commands) > 0 {
709 fmt.Fprintln(os.Stderr)
710 config := console.TableConfig{
711 Headers: []string{"Command", fmt.Sprintf("Run #%d", run1ID), fmt.Sprintf("Run #%d", run2ID), "Change", "Max Input", "Max Output"},
712 Rows: make([][]string, 0, len(diff.Commands)),
713 }
714 for _, cmd := range diff.Commands {
715 change := cmd.CallCountChange
716 if change == "" {
717 change = "—"
718 }
719 config.Rows = append(config.Rows, []string{
720 cmd.Name,
721 strconv.Itoa(cmd.Run1CallCount),
722 strconv.Itoa(cmd.Run2CallCount),
723 change,
724 formatMaxSizeCell(cmd.Run1MaxInputSize, cmd.Run2MaxInputSize),
725 formatMaxSizeCell(cmd.Run1MaxOutputSize, cmd.Run2MaxOutputSize),
726 })
727 }
728 fmt.Fprint(os.Stderr, console.RenderTable(config))
729 }
730}
731
732// renderToolCallsDiffMarkdownSection renders the engine-level tool calls diff as markdown.
733// It includes a full tool type table and a bash commands breakdown.

Callers 1

Calls 4

FormatSectionHeaderFunction · 0.92
FormatInfoMessageFunction · 0.92
RenderTableFunction · 0.92
formatMaxSizeCellFunction · 0.85

Tested by

no test coverage detected