Address finding command review nits · Entire

Address finding command review nits

d6027cd→main·

dipree·4w ago·1 file·+16 added/-8 removed

Sessions

86736c00aab7View transcript

[?
Validate Empty Body Error HandlingPi·GPT-5.5·4 steps](/content/gh/entireio/cli/session/019ee01d-b0c6-7aee-8f6c-ecc52fa9e906#timeline-86736c00aab7/index.html)

Changes

1

244 unmodified lines

245
246
247
248
248
249
250
251
252
253
254
255
3 unmodified lines

259
260
261
258
259
260
261
262
263
264
1018 unmodified lines

1283
1284
1285
1286
1287
1286
1287
1288
1289
1289
1290
1291
1292
1293
3 unmodified lines

1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309

244 unmodified lines

cmd := &cobra.Command{
        Use:   "apply [<trail>] <finding-id>",
        Short: "Apply a finding's unified-diff suggestion",
        Args:  cobra.RangeArgs(1, 2),
        Long: `Apply a finding's unified-diff suggestion to the current worktree.

By default this only changes files. Pass --resolve to update the finding's
lifecycle status after the patch applies successfully.`,
        Args: cobra.RangeArgs(1, 2),
        RunE: func(cmd *cobra.Command, args []string) error {
            selector, commentID, err := parseTrailSelectorAndCommentID(args, targetOpts.Selector)
            if err != nil {
3 unmodified lines

},
        }
    cmd.Flags().BoolVar(&opts.Resolve, "resolve", false, "Mark the finding resolved after applying")
    cmd.Long = `Apply a finding's unified-diff suggestion to the current worktree.

By default this only changes files. Pass --resolve to update the finding's
lifecycle status after the patch applies successfully.`
    cmd.Flags().BoolVar(&opts.Check, "check", false, "Only check whether the patch applies; do not modify files")
    return cmd
}
1018 unmodified lines

}

func printTrailReviewCommentsTable(w io.Writer, comments []api.TrailReviewComment) {
    tw := tabwriter.NewWriter(w, 0, 0, 2, ' ', 0)
    fmt.Fprintln(tw, "  ID\tSEV\tSTATUS\tFRESHNESS\tLOCATION\tSUMMARY")
    var table bytes.Buffer
    tw := tabwriter.NewWriter(&table, 0, 0, 2, ' ', 0)
    fmt.Fprintln(tw, "ID\tSEV\tSTATUS\tFRESHNESS\tLOCATION\tSUMMARY")
    for _, comment := range comments {
        fmt.Fprintf(tw, "  %s\t%s\t%s\t%s\t%s\t%s\n",
        fmt.Fprintf(tw, "%s\t%s\t%s\t%s\t%s\t%s\n",
            abbreviate12(comment.ID),
            severityTableDisplay(comment.Severity),
            comment.Status,
3 unmodified lines

)
    }
    _ = tw.Flush()
    printIndentedBlock(w, table.String(), "  ")
}

func printIndentedBlock(w io.Writer, block, indent string) {
    for line := range strings.SplitSeq(strings.TrimRight(block, "\n"), "\n") {
        fmt.Fprintln(w, indent+line)
    }
}

func printTrailReviewCommentCreated(w io.Writer, target trailReviewTarget, comment api.TrailReviewComment) {