-
-
Notifications
You must be signed in to change notification settings - Fork 139
Add no-color support for atmos #1227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Benbentwo
merged 39 commits into
main
from
feature/dev-3177--no-color-should-be-a-global-flag
May 14, 2025
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
1fff23f
add no-color support for atmos
samtholiya 4cd8889
fix test case error
samtholiya 896b4ef
fix test case
samtholiya d7c7fc6
fix tests
samtholiya 59964b0
Merge branch 'main' into feature/dev-3177--no-color-should-be-a-globa…
samtholiya 5f5cab2
removed editorconfig color parameter
samtholiya e38d2e4
Merge branch 'feature/dev-3177--no-color-should-be-a-global-flag' of …
samtholiya 159ac32
fixed test case
samtholiya 6d28396
configuration refactor
samtholiya 5bf115e
add test case for color vs no-color
samtholiya cd8d695
[autofix.ci] apply automated fixes
autofix-ci[bot] 139ffb4
added test for no color
samtholiya 3e82d10
Merge branch 'feature/dev-3177--no-color-should-be-a-global-flag' of …
samtholiya d1b9045
added tests
samtholiya 14534fb
fix logging render
samtholiya 31aff06
fix lint
samtholiya 61e1c7f
fix exception
samtholiya 2bf2e0b
fix tests
samtholiya 8737e9d
fix tests
samtholiya a0890d6
add test coverage
samtholiya b7fc01b
add more test coverage
samtholiya c832868
try fix
samtholiya d05600e
revert support test to check windows
samtholiya 31e182c
configuration markdown update
samtholiya 08f3dc1
added more test case
samtholiya 8f70892
fix test case
samtholiya d6a02ed
revert the change
samtholiya 6aff052
add logs to the test
samtholiya de270f7
added more logs
samtholiya 131249b
check this
samtholiya feb782c
test windows check
samtholiya 992c98b
support test case added
samtholiya 39bbe6c
added documentation
samtholiya efd3bf7
Merge branch 'main' into feature/dev-3177--no-color-should-be-a-globa…
samtholiya 7a5c193
Fix code rabbit comment
samtholiya 3cc559b
Merge branch 'main' into feature/dev-3177--no-color-should-be-a-globa…
samtholiya f6742a1
Merge branch 'main' into feature/dev-3177--no-color-should-be-a-globa…
Benbentwo ba10aad
[autofix.ci] apply automated fixes
autofix-ci[bot] 765da27
update tests
Benbentwo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| package cmd | ||
|
|
||
| import ( | ||
| "bytes" | ||
| "os" | ||
| "strings" | ||
| "testing" | ||
|
|
||
| log "github.com/charmbracelet/log" | ||
| ) | ||
|
|
||
| func TestNoColorLog(t *testing.T) { | ||
| // Set the environment variable to disable color | ||
| // t.Setenv("NO_COLOR", "1") | ||
| t.Setenv("ATMOS_LOGS_LEVEL", "Debug") | ||
| t.Setenv("NO_COLOR", "1") | ||
| // Create a buffer to capture the output | ||
| var buf bytes.Buffer | ||
| log.SetOutput(&buf) | ||
|
|
||
| oldArgs := os.Args | ||
| defer func() { | ||
| os.Args = oldArgs | ||
| }() | ||
| // Set the arguments for the command | ||
| os.Args = []string{"atmos", "about"} | ||
| // Execute the command | ||
| if err := Execute(); err != nil { | ||
| t.Fatalf("Failed to execute command: %v", err) | ||
| } | ||
| // Check if the output is without color | ||
| output := buf.String() | ||
| if strings.Contains(output, "\033[") { | ||
| t.Errorf("Expected no color in output, but got: %s", output) | ||
| } | ||
| t.Log(output, "output") | ||
| } |
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.