leeway
leeway copied to clipboard
[WIP] Find a bug and fix it
- [x] Explored repository structure and understood leeway is a build system for Go, Yarn and Docker projects
- [x] Built project successfully (though with long download times)
- [x] Discovered failing test
TestConsoleReporterinpkg/leeway/reporter_test.go - [x] Identified the bug: Console reporter outputs ANSI color codes even when writing to buffers during tests
- [x] Analyzed the issue: The test expects plain text but gets text with color escape sequences
- [x] Found root cause: gookit/color package's global
Enablevariable controls color rendering but is always on - [x] Fixed the bug by adding conditional color rendering based on output destination
- [x] Implemented
shouldUseColor()method to detect if output is going to stdout vs buffer - [x] Added
colorSprintf()helper method that strips color tags for non-TTY output - [x] Updated all color usage in ConsoleReporter to use conditional rendering
- [x] Verified the fix passes all ConsoleReporter tests
- [x] Run full test suite to ensure no regressions - all tests pass
- [x] Final validation that colors still work for actual console output
- [x] Built and tested final binary - works correctly
Summary: Fixed a bug where the ConsoleReporter in the leeway build system was outputting ANSI color escape codes even when writing to test buffers, causing test failures. The solution adds intelligent color detection that only enables colors when outputting to stdout (real console) but disables them when outputting to buffers during tests.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.