Style human-readable install progress - #883
Conversation
🤖 Augment PR SummarySummary: This PR adds semantic ANSI styling to human-readable
🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
2 issues found across 11 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/command_install.cc">
<violation number="1" location="src/command_install.cc:247">
P2: Frozen mismatches are failures, but this label remains yellow. Select `FAILURE_STYLE` when `orphaned_behavior == OrphanedBehavior::Error` and keep `WARNING_STYLE` for automatically repaired mismatches.</violation>
</file>
<file name="test/install/fail_frozen_mismatch_color_always.clitest">
<violation number="1" location="test/install/fail_frozen_mismatch_color_always.clitest:41">
P3: These new frozen failure tests cover only human-readable output, leaving JSON failure events unverified. Add a matching `--json --color always` run and compare its structured events for all three `fail_frozen_*_color_always` cases.
(Based on your team's feedback about JSON variants for failure tests.) [8987a25a-4f41-4a67-914e-ada0d55918a7]</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| std::cerr << padded_label("Mismatched", WARNING_STYLE) | ||
| << event.path.generic_string() << "\n"; |
There was a problem hiding this comment.
P2: Frozen mismatches are failures, but this label remains yellow. Select FAILURE_STYLE when orphaned_behavior == OrphanedBehavior::Error and keep WARNING_STYLE for automatically repaired mismatches.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/command_install.cc, line 247:
<comment>Frozen mismatches are failures, but this label remains yellow. Select `FAILURE_STYLE` when `orphaned_behavior == OrphanedBehavior::Error` and keep `WARNING_STYLE` for automatically repaired mismatches.</comment>
<file context>
@@ -221,7 +244,7 @@ auto make_on_event(const sourcemeta::core::Options &options,
event.path.generic_string());
} else {
- std::cerr << padded_label("Mismatched")
+ std::cerr << padded_label("Mismatched", WARNING_STYLE)
<< event.path.generic_string() << "\n";
}
</file context>
| std::cerr << padded_label("Mismatched", WARNING_STYLE) | |
| << event.path.generic_string() << "\n"; | |
| std::cerr << padded_label( | |
| "Mismatched", orphaned_behavior == OrphanedBehavior::Error | |
| ? FAILURE_STYLE | |
| : WARNING_STYLE) | |
| << event.path.generic_string() << "\n"; |
| COPY project/jsonschema.lock.json TO lock_before.json | ||
|
|
||
| // Validation failure with forced color | ||
| RUN install --frozen --color always STDIN /dev/null IN project INTO result_1.txt EXPECTING 2 |
There was a problem hiding this comment.
P3: These new frozen failure tests cover only human-readable output, leaving JSON failure events unverified. Add a matching --json --color always run and compare its structured events for all three fail_frozen_*_color_always cases.
(Based on your team's feedback about JSON variants for failure tests.) [8987a25a-4f41-4a67-914e-ada0d55918a7]
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/install/fail_frozen_mismatch_color_always.clitest, line 41:
<comment>These new frozen failure tests cover only human-readable output, leaving JSON failure events unverified. Add a matching `--json --color always` run and compare its structured events for all three `fail_frozen_*_color_always` cases.
(Based on your team's feedback about JSON variants for failure tests.) [8987a25a-4f41-4a67-914e-ada0d55918a7]</comment>
<file context>
@@ -0,0 +1,56 @@
+COPY project/jsonschema.lock.json TO lock_before.json
+
+// Validation failure with forced color
+RUN install --frozen --color always STDIN /dev/null IN project INTO result_1.txt EXPECTING 2
+
+REPLACE $CWD_URI WITH '[CWD_URI]' IN result_1.txt
</file context>
Signed-off-by: HarshPopat23 <musichk61@gmail.com>
df93bf7 to
35e3e9f
Compare
Summary
Style the human-readable progress labels emitted by
jsonschema install.Progress labels use bold cyan, successful states use bold green, recoverable or automatically repaired states use bold yellow, and frozen-mode failures use bold red. Only the fixed-width label is styled; paths, URIs and separators remain plain. The existing 14-character alignment is calculated from the unstyled label, so ANSI escape sequences do not affect column alignment.
Compatibility
--color autooutput remains plain.--color neverremains plain.install --jsonremains ANSI-free and byte-for-byte compatible.Tests
Added CLI coverage for forced-color installation, up-to-date dependencies, adding dependencies, repaired and frozen orphan states, frozen failures, explicit no-color behavior and JSON output.