Skip to content

Feat/issue 37 shorthand test path#43

Open
thinkingjet wants to merge 6 commits into
codesoda:mainfrom
thinkingjet:feat/issue-37-shorthand-test-path
Open

Feat/issue 37 shorthand test path#43
thinkingjet wants to merge 6 commits into
codesoda:mainfrom
thinkingjet:feat/issue-37-shorthand-test-path

Conversation

@thinkingjet
Copy link
Copy Markdown

No description provided.

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.
Copilot AI review requested due to automatic review settings April 18, 2026 13:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 output module with lazily initialized stdout/stderr color palettes (respecting NO_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.

Comment thread src/claude_code.rs Outdated
Comment thread src/output.rs
Comment thread src/main.rs Outdated
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.
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