Skip to content
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

fix!: Make color settings an enum #2851

Merged
merged 2 commits into from Oct 13, 2021
Merged

fix!: Make color settings an enum #2851

merged 2 commits into from Oct 13, 2021

Conversation

pksunkara
Copy link
Member

@pksunkara pksunkara commented Oct 11, 2021

This switches us from individual AppSettings for each state to an enum

We did not provide yaml support, assuming this is more of a runtime decision while yaml is more static.

Fixes #2811

@pksunkara pksunkara linked an issue Oct 11, 2021 that may be closed by this pull request
@pksunkara pksunkara force-pushed the color-enum branch 2 times, most recently from 8283a0b to 8fbed8b Compare October 11, 2021 23:05
epage
epage previously requested changes Oct 11, 2021
Copy link
Member

@epage epage left a comment

Choose a reason for hiding this comment

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

Runtime support for Never is needed.

@pksunkara pksunkara force-pushed the color-enum branch 2 times, most recently from fce9d21 to 6062970 Compare October 12, 2021 09:44
@pksunkara
Copy link
Member Author

@epage Can you look at the API? I will add docs if good.

src/build/app/mod.rs Outdated Show resolved Hide resolved
src/build/app/settings.rs Show resolved Hide resolved
src/util/color.rs Outdated Show resolved Hide resolved
src/build/app/mod.rs Outdated Show resolved Hide resolved
src/util/color.rs Outdated Show resolved Hide resolved
@pksunkara
Copy link
Member Author

Updated.

@epage epage changed the title Remove ColorNever and ColorAuto app settings fix!: Make color settings an enum Oct 13, 2021
Copy link
Member

@epage epage left a comment

Choose a reason for hiding this comment

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

Did a rough pass at title / summary just to avoid it falling through the cracks. Feel free to correct anything and have bors kick things off.

@pksunkara
Copy link
Member Author

bors r+

bors bot added a commit that referenced this pull request Oct 13, 2021
2851: fix!: Make color settings an enum r=pksunkara a=pksunkara



Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
@bors
Copy link
Contributor

bors bot commented Oct 13, 2021

Build failed:

@pksunkara
Copy link
Member Author

bors retry

@bors
Copy link
Contributor

bors bot commented Oct 13, 2021

🕐 Waiting for PR status (Github check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

@bors
Copy link
Contributor

bors bot commented Oct 13, 2021

Build succeeded:

@bors bors bot merged commit 1f17d9e into master Oct 13, 2021
@bors bors bot deleted the color-enum branch October 13, 2021 14:13
epage added a commit to epage/clap that referenced this pull request Nov 11, 2021
In clap-rs#2851, we moved color from an AppSetting to function (with some
tweaks in clap-rs#2907).  When doing this, we documented `App::color` to be
equivelant of `App::global_settings(Color...)` but never actually
propogated it.

We are now propogating it.  A test is added to ensure that no matter
how we store the color choice, we continue to propogate it.  This
required exposing `App::get_color`.
epage added a commit to epage/clap that referenced this pull request Nov 11, 2021
In clap-rs#2851, we moved color from an AppSetting to function (with some
tweaks in clap-rs#2907).  When doing this, we documented `App::color` to be
equivalent of `App::global_settings(Color...)` but never actually
propagated it.

We are now propagating it.  A test is added to ensure that no matter
how we store the color choice, we continue to propagate it.  This
required exposing `App::get_color`.
@epage epage mentioned this pull request Nov 11, 2021
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.

Color should be exposed as a single enum, not individual Settings
2 participants