Skip to content

Add no-color support for atmos - #1227

Merged
Ben (Benbentwo) merged 39 commits into
mainfrom
feature/dev-3177--no-color-should-be-a-global-flag
May 14, 2025
Merged

Ben (Benbentwo) merged 39 commits into
mainfrom
feature/dev-3177--no-color-should-be-a-global-flag

Conversation

@samtholiya

@samtholiya Sam Tholiya (samtholiya) commented Apr 30, 2025 •

Copy link
Copy Markdown
Contributor

what

  • We are adding support for no color output for atmos

why

  • Customer having custom terminal find it difficult to look at the content. Having no color option helps customer to have a visible output

references

Summary by CodeRabbit

  • New Features

    • Added a global --no-color flag to disable colored output in logs and terminal display.
    • Introduced a no_color configuration option with environment variable support (ATMOS_NO_COLOR, NO_COLOR).
  • Bug Fixes

    • Fixed removal of ANSI color codes from logs and markdown rendering when color output is disabled.
  • Documentation

    • Updated CLI help texts and configuration docs to include the new no_color option and flag usage.
  • Tests

    • Added tests validating the --no-color flag, configuration parsing, and markdown rendering without color.
    • Included new snapshot tests and support command test cases.
  • Refactor

    • Replaced previous color-related configuration fields with the new no_color setting for clarity and consistency.

@samtholiya Sam Tholiya (samtholiya) added the minor New features that do not break anything label Apr 30, 2025
if atmosConfig.Settings.Terminal.NoColor {
renderer, err := glamour.NewTermRenderer(
glamour.WithAutoStyle(),
glamour.WithWordWrap(int(r.width)),

Check failure

Code scanning / golangci-lint

G115: integer overflow conversion uint -> int

G115: integer overflow conversion uint -> int
@github-actions github-actions Bot added size/m and removed size/s labels May 1, 2025
@codecov

codecov Bot commented May 1, 2025 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 72.46377% with 19 lines in your changes missing coverage. Please review.

Project coverage is 34.83%. Comparing base (9ee823d) to head (765da27).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/ui/markdown/renderer.go 75.00% 8 Missing and 4 partials ⚠️
cmd/validate_editorconfig.go 0.00% 2 Missing and 2 partials ⚠️
pkg/config/config.go 40.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1227      +/-   ##
==========================================
+ Coverage   33.74%   34.83%   +1.09%     
==========================================
  Files         229      229              
  Lines       24573    24611      +38     
==========================================
+ Hits         8291     8573     +282     
+ Misses      15060    14791     -269     
- Partials     1222     1247      +25     
Flag Coverage Δ
unittests 34.83% <72.46%> (+1.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread pkg/ui/markdown/renderer.go Fixed
Comment thread pkg/ui/markdown/renderer.go Fixed
@samtholiya
Sam Tholiya (samtholiya) force-pushed the feature/dev-3177--no-color-should-be-a-global-flag branch from d1297fb to 14534fb Compare May 1, 2025 15:52
Comment thread cmd/root.go Fixed
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 9, 2025
@mergify

mergify Bot commented May 13, 2025

Copy link
Copy Markdown
Contributor

💥 This pull request now has conflicts. Could you fix it Sam Tholiya (@samtholiya)? 🙏

@mergify mergify Bot added the conflict This PR has conflicts label May 13, 2025
…l-flag

# Conflicts:
#	pkg/config/default.go
#	pkg/config/load.go
#	pkg/schema/schema.go
#	tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden
#	tests/snapshots/TestCLICommands_atmos_describe_config_imports.stdout.golden
@mergify mergify Bot removed the conflict This PR has conflicts label May 14, 2025
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 14, 2025

This branch was successfully deployed

1 active deployment
preview — 765da278 Deployed May 14, 2025 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor New features that do not break anything

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants