Add readable pretty-JSON output and validation tests - #61
Merged
Merged
Conversation
mattleibow
force-pushed
the
pr56c/04-e-emulator-lifecycle
branch
from
February 17, 2026 14:37
953a2e5 to
952bd94
Compare
mattleibow
force-pushed
the
pr56c/05-f-output-validation
branch
from
February 17, 2026 14:37
35973ca to
f6c6a27
Compare
mattleibow
force-pushed
the
pr56c/05-f-output-validation
branch
2 times, most recently
from
February 17, 2026 18:20
ab2e2bb to
2d64967
Compare
mattleibow
force-pushed
the
pr56c/04-e-emulator-lifecycle
branch
from
February 17, 2026 18:20
dc3f753 to
660ed0f
Compare
mattleibow
force-pushed
the
pr56c/05-f-output-validation
branch
from
February 17, 2026 19:17
2d64967 to
9396625
Compare
mattleibow
changed the base branch from
pr56c/04-e-emulator-lifecycle
to
main
February 17, 2026 19:17
There was a problem hiding this comment.
Pull request overview
This PR adds a new OutputFormat.JsonPretty option to provide human-readable, indented JSON output while preserving the existing compact JSON format. This addresses the previous breaking change where JSON output was changed from indented to compact, now offering both options explicitly.
Changes:
- Added
OutputFormat.JsonPrettyenum value for indented JSON output - Updated
OutputHelperto support the new format and changed visibility to public for testing - Enhanced
OutputFormatTypeConverterto parse "jsonpretty" string input - Added comprehensive tests for output formatting and command settings validation
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| AndroidSdk.Tool/Program.cs | Added JsonPretty enum value to OutputFormat |
| AndroidSdk.Tool/OutputHelper.cs | Changed visibility to public, updated JsonSerialize signature to support indentation, added JsonPretty handling in all output methods, switched from AnsiConsole to Console for JSON/XML output |
| AndroidSdk.Tool/OutputFormatTypeConverter.cs | Added conversion logic for "jsonpretty" string to OutputFormat.JsonPretty |
| AndroidSdk.Tests/OutputHelper_Tests.cs | New test file with comprehensive output format validation tests |
| AndroidSdk.Tests/CommandSettingsValidation_Tests.cs | New test file validating AVD command settings and output format converter |
| AndroidSdk.Tests/AndroidSdk.Tests.csproj | Added Spectre.Console dependencies and AndroidSdk.Tool project reference |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mattleibow
added a commit
that referenced
this pull request
Feb 17, 2026
Adds OutputFormat.JsonPretty support with 'json-pretty' alias. Comprehensive tests for all OutputFormat options including Json, JsonPretty, Xml, and Table formats. Fixes NRE in OutputFormatTypeConverter. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nd comprehensive format coverage Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove unused using in OutputHelper_Tests - Add tests for OutputFormat.JsonPretty with IEnumerable and single item overloads - Update OutputFormatTypeConverter to support 'json-pretty' alias - Add test for 'json-pretty' alias support
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
mattleibow
force-pushed
the
pr56c/05-f-output-validation
branch
from
February 17, 2026 21:20
a7064f0 to
0640a34
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this change matters
Compact JSON is useful for scripts, but hard to read when inspecting CLI output manually. This PR adds an explicit pretty-JSON mode while preserving existing compact JSON behavior.
What is included
OutputFormat.JsonPrettyinProgram.cs.OutputFormatTypeConverterto parse bothjsonprettyandjson-pretty(case-insensitive), and to safely handle null/empty values by returningOutputFormat.None.OutputHelperto support pretty JSON across all output overloads while keeping compact JSON forOutputFormat.Json.Console.Write/WriteLineand table rendering onAnsiConsole.OutputHelper_Testsfor compact JSON, pretty JSON, XML, table output, and output capture.CommandSettingsValidation_Testsfor AVD settings validation and output-format converter aliases.AndroidSdk.Tests.csprojwith theAndroidSdk.Toolproject reference plus Spectre.Console dependencies needed by the new tests.Validation
dotnet build --nologo --verbosity minimaldotnet test AndroidSdk.Tests/AndroidSdk.Tests.csproj --configuration Release --no-build --nologo --verbosity minimal --filter "FullyQualifiedName~OutputHelper_Tests|FullyQualifiedName~CommandSettingsValidation_Tests"