Feat/issue 37 shorthand test path#43
Open
thinkingjet wants to merge 6 commits into
Open
Conversation
Implements issue codesoda#15 behavior across main and claude-code output paths. Changes: - Add src/output.rs with color_enabled() and ansi() helpers - Export output module from src/lib.rs - Gate ANSI banner and styled run labels in src/main.rs - Gate verbose ANSI formatting in src/claude_code.rs Validation run: - cargo check -q - cargo test --all-targets - cargo test --doc - cargo run --quiet -- test DOES_NOT_EXIST.test.toml 2>&1 | cat -v - script -q /dev/null cargo run --quiet -- test DOES_NOT_EXIST.test.toml | cat -v - NO_COLOR=1 script -q /dev/null cargo run --quiet -- test DOES_NOT_EXIST.test.toml | cat -v
Use OnceLock-backed Colors palette to avoid repeated NO_COLOR/TTY checks on every color lookup. - Add public Colors fields for shared styling constants - Provide colors() singleton accessor and output prelude exports - Switch main.rs and claude_code.rs call sites to shared palette Validation: - cargo check -q - cargo test -q --all-targets - runtime checks for piped, TTY default, and NO_COLOR=1
Use separate lazy palettes for stdout and stderr to avoid ANSI leaks when only one stream is redirected. - Add Stream enum and per-stream OnceLock palettes - Add stdout_colors()/stderr_colors() accessors - Keep existing helpers for compatibility - Route claude verbose eprintln! paths to stderr palette Validation: - cargo check -q - cargo test -q --all-targets - smoke checks for piped, TTY, NO_COLOR, and redirected stderr
Implements issue codesoda#37 by resolving bugatti test name to name.test.toml when exact path is missing. Resolution order is constant-time: exact path check, then one shorthand fallback check. Adds unit tests for shorthand candidate construction and path resolution behavior. Validation: cargo test -q --all-targets and smoke run from /tmp/bugatti-issue37-smoke using bugatti test ftue.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a shorthand resolution for bugatti test <path> and centralizes ANSI styling so terminal coloring can be enabled/disabled consistently across stdout/stderr.
Changes:
- Add shorthand test path resolution: try
<input>first, then<input>.test.toml. - Introduce a shared
outputmodule with lazily initialized stdout/stderr color palettes (respectingNO_COLOR+ TTY detection). - Update CLI banner and verbose Claude Code logs to use the shared palette instead of hardcoded ANSI sequences.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/output.rs | New shared ANSI palette with stdout/stderr enablement detection and helpers. |
| src/main.rs | Adds shorthand test path resolution + uses shared colors for banner and per-test output. |
| src/lib.rs | Exposes the new output module from the library crate. |
| src/claude_code.rs | Replaces local ANSI constants with shared stderr palette for verbose logging. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address PR feedback while preserving behavior. - resolve_test_path now accepts only real files via is_file() - reject directory inputs early and keep shorthand fallback - cache stderr color palette at StreamTurnIterator creation - avoid unconditional stderr_colors lookup on every next() call Validation: cargo check -q, cargo test -q --all-targets, smoke test for directory input.
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.
No description provided.