Repository navigation
feat(#15): --format pretty + --color flag + new default - #16
Merged
Merged
Conversation
…rMode message, auto-downgrade test)
…rade docs - Pin within-file sort to first-hop line (guards sort-by-later-hop mutant). - Pin explain:false suppression even when trace is non-empty (guards the ! $this->explain guard against an && mutation). - Add exact-byte AnsiStyler fixture proving *YOURS* routes to annotation() (bold-magenta) and (stored) to terminalKind() (dim-green) — pins the hopLine ternary against a branch swap. - Refine CHANGELOG/README/docs/plan to state the downgrade is gated on --color=auto (the default): --color=never keeps plain pretty in a pipe, --color=always keeps colored pretty (escape hatch for less -R).
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.
Closes #15.
Summary
Adds a seventh output format,
pretty— well-formatted, colored terminal output that becomes the new default when STDOUT is a TTY. Thetextformat remains opt-in via--format textand is frozen (zero diff onTextReporter/TextReporterTest).What's new
PrettyReporter— file-grouped (alphabetical), within-file line-sorted, structural typography, 64-char divider before the summary. No borders, no icons beyondFINDING/WARNING.Stylerseam — one method per semantic role.NullStyler(color-off) andAnsiStyler(8-color, the onlysrc/class that emits\e).PrettyReporterhas zero color-branch logic.ColorPolicy::from(string \$mode, bool \$tty, bool \$noColorSet): Styler— pure 3-input resolver. Exhaustive Q11 truth table pinned inColorPolicyTest.--color=always|auto|never(git-style, defaultauto) +Options::\$colorMode.NO_COLORhonored only inauto;always/neverare absolute.colorModeconfig key inphptramp.json/phptramp.dist.json(strict type + membership validation).ReporterFactory::create(Options, Styler)— routesprettythrough the Styler.Applicationis the only place that readsstream_isatty(STDOUT)/getenv('NO_COLOR'). Downgradespretty→texton non-TTY when--color=auto(the default), so pipes/CI stay plain.--color=neverkeeps plainprettyin a pipe;--color=alwayskeeps coloredpretty(escape hatch forless -R).--formatflippedtext→pretty(TTY-gated; non-TTY downgrade keeps existing non-TTY tests green).docs/plan.mdfrozen semantic / help text updated.Architecture constraints honored
Styler.textformat and its exact-string tests untouched.Verification
composer checkgreen: 489 tests, 1552 assertions.composer infection:diff94% MSI (gate is 80%); zero escaped mutants onPrettyReporter.php.Migration
textautomatically (the default--color=autodowngrades non-TTYprettytotext).prettyinto a pipe:--color=always. To force plainpretty(file-grouped, no ANSI):--color=never.--format textto force the old default on a TTY.