Skip to content

feat: allow to set styles in options#133

Open
op wants to merge 1 commit intocharmbracelet:mainfrom
op:op/styles-option
Open

feat: allow to set styles in options#133
op wants to merge 1 commit intocharmbracelet:mainfrom
op:op/styles-option

Conversation

@op
Copy link
Contributor

@op op commented Jun 19, 2024

This allow you to set styles directly from options instead of calling SetStyles.

@op op requested a review from aymanbagabas as a code owner June 19, 2024 17:39
@codecov
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.63%. Comparing base (2338a13) to head (e9ca10a).
⚠️ Report is 51 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #133      +/-   ##
==========================================
+ Coverage   80.92%   82.63%   +1.71%     
==========================================
  Files          11       11              
  Lines         739      714      -25     
==========================================
- Hits          598      590       -8     
+ Misses        126      108      -18     
- Partials       15       16       +1     

☔ 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.

l.SetOutput(w)
l.SetLevel(Level(l.level))
l.SetStyles(DefaultStyles())
l.SetStyles(o.Styles)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
l.SetStyles(o.Styles)
styles := o.Styles
if styles == nil {
styles = DefaultStyles()
}
l.SetStyles(styles)

Copy link
Member

@aymanbagabas aymanbagabas left a comment

Choose a reason for hiding this comment

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

Could you add a test case?

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