Skip to content

format output - #4

Merged
bubunyo merged 1 commit into
masterfrom
feat/verboseness
Mar 8, 2026
Merged

format output#4
bubunyo merged 1 commit into
masterfrom
feat/verboseness

Conversation

@bubunyo

@bubunyo bubunyo commented Mar 8, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 8, 2026 04:37
@bubunyo
bubunyo merged commit b2e1b6c into master Mar 8, 2026
7 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR cleans up the output behavior of the buildgraph CLI tool: it migrates diagnostic/progress messages from the log package (which prefixes timestamps) to fmt.Fprintf(os.Stderr, ...), removes internal-detail fields from the JSON output, and changes the default output format from JSON to text.

Changes:

  • log replaced with fmt.Fprintf(os.Stderr, ...) / fmt.Fprintln(os.Stderr, ...) across all CLI files for cleaner, timestamp-free stderr output.
  • Impact.AffectedFunctions and Impact.AffectReasons excluded from JSON serialization (json:"-"); Impact.Changes field removed from both the type and its initialization.
  • Default output format for analyze changed from "json" to "text", and the format flag description updated accordingly.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
cli/analyze.go Removed leftover log progress/summary messages; changed default --format flag from "json" to "text"
cli/output.go Replaced log.Fatalf with fmt.Fprintf+os.Exit(1); removed fixed-width padding from change type in text output
cli/pipeline.go Replaced all log.Printf calls with fmt.Fprintf(os.Stderr, ...)
cli/root.go Replaced log.Fatalf with fmt.Fprintf+os.Exit(1) in config loading
pkg/types/types.go Excluded AffectedFunctions and AffectReasons from JSON; removed Changes field from Impact
pkg/impact/impact.go Removed initialization of the now-deleted Changes field in ComputeImpact

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cli/analyze.go

func init() {
analyzeCmd.Flags().StringP("format", "f", "json", "Output format: json, text")
analyzeCmd.Flags().StringP("format", "f", "text", "Output format: text, json")

Copilot AI Mar 8, 2026

Copy link

Choose a reason for hiding this comment

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

The README.md states that JSON is the default output format (# JSON output (default)) for buildgraph analyze, but this PR changes the default from "json" to "text". The README documentation is now incorrect and should be updated to reflect that text is the new default (i.e., swap the examples so text is the default and json requires --format json).

Copilot uses AI. Check for mistakes.
Comment thread pkg/types/types.go
Comment on lines +73 to +74
AffectedFunctions map[string][]string `json:"-"`
AffectReasons map[string][]string `json:"-"`

Copilot AI Mar 8, 2026

Copy link

Choose a reason for hiding this comment

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

The AffectedFunctions and AffectReasons fields of the Impact struct are now tagged with json:"-", excluding them from the JSON output. However, the README.md JSON output example still shows "affected_functions" as part of the impact object, and SPEC.md documents both affected_functions and affect_reasons with their original JSON tags. These documentation artifacts are now incorrect and should be updated to match the new JSON output, which only includes "services_to_build" under "impact".

Copilot uses AI. Check for mistakes.
@bubunyo
bubunyo deleted the feat/verboseness branch March 13, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants