fix: implement disableColors and add git blame debug logging#23
Merged
yiftach-armis merged 2 commits intomainfrom Jan 7, 2026
Merged
fix: implement disableColors and add git blame debug logging#23yiftach-armis merged 2 commits intomainfrom
yiftach-armis merged 2 commits intomainfrom
Conversation
Collaborator
yiftach-armis
commented
Jan 7, 2026
- Implement disableColors() to set ANSI color variables to empty strings
- Add NO_COLOR environment variable support (https://no-color.org/)
- Add debug logging when git blame fails (not a repo, file missing, command error)
- Pass debug flag through FormatOptions to formatter
- Fix staticcheck nil pointer warning in human_test.go
- Implement disableColors() to set ANSI color variables to empty strings - Add NO_COLOR environment variable support (https://no-color.org/) - Add debug logging when git blame fails (not a repo, file missing, command error) - Pass debug flag through FormatOptions to formatter - Fix staticcheck nil pointer warning in human_test.go
Test Coverage Reporttotal: (statements) 56.5% Coverage by function |
There was a problem hiding this comment.
Pull request overview
This PR implements support for disabling ANSI color codes and adds debug logging for git blame operations. The changes improve accessibility by supporting the NO_COLOR standard and provide better diagnostics when git blame fails.
Key Changes:
- Implemented disableColors() function with NO_COLOR environment variable support
- Added debug logging to diagnose git blame failures (non-repo, missing file, command errors)
- Fixed staticcheck nil pointer warning in human_test.go
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/output/output.go | Added Debug field to FormatOptions struct to enable debug logging |
| internal/output/human_test.go | Added return statement after t.Fatal() to fix staticcheck nil pointer warning |
| internal/output/human.go | Implemented disableColors() function, added NO_COLOR support, and debug logging for git blame operations |
| internal/cmd/scan_repo.go | Passed debug flag to FormatOptions for repo scanning |
| internal/cmd/scan_image.go | Passed debug flag to FormatOptions for image scanning |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- TestDisableColors: verify all color variables are set to empty strings - TestFormattedOutputWithoutColors: verify formatted output has no ANSI codes - Both tests properly save and restore color values to avoid test pollution
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.