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

Use _CONFIG_ to separate config prefix and key #2848

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bugadani
Copy link
Contributor

A lazy attempt to resolve #2846

@bugadani bugadani force-pushed the prefix branch 4 times, most recently from 65afc4b to 04edbe8 Compare December 20, 2024 09:16
@bugadani bugadani marked this pull request as ready for review December 20, 2024 11:18
@@ -33,7 +33,7 @@ PASSWORD = "PASSWORD"
STATIC_IP = "1.1.1.1 "
GATEWAY_IP = "1.1.1.1"
HOST_IP = "1.1.1.1"
ESP_WIFI_CSI_ENABLE = "true"
ESP_WIFI__CSI_ENABLE = "true"
Copy link
Contributor

Choose a reason for hiding this comment

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

looking at this changed line I wonder if a less subtle prefix would be more user-friendly.

I can imagine users missing the second underscore and having a hard time to figure out why setting cfg-value doesn't have any effect - they won't get any indication of an error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm just dropping this in as the "McDonald's idea" of solutions. If anyone knows anything better, let's do that, but until then, this is a fallback :)

We are limited to what we can encode in an environment variable's name, unfortunately.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure but something like _CFG_ is less likely to be unspotted

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I agree with @bjoernQ, __ is likely to be missed. I think either _CFG_ or personally I'd prefer _CONFIG_ but either is fine with me.

Copy link
Collaborator

Choose a reason for hiding this comment

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

There's also the tedious option of renaming the esp-hal-embassy crate to esp-embassy, which would be consistent with literally every other crate (except the procmacros one).

(Unless there's a naming convention I'm missing)

Copy link
Contributor Author

@bugadani bugadani Dec 20, 2024

Choose a reason for hiding this comment

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

@bugadani bugadani force-pushed the prefix branch 2 times, most recently from 09f77b3 to 6a00c53 Compare December 20, 2024 15:26
Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

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

LGTM

@bugadani bugadani changed the title Use two underscores to separate prefix Use _CONFIG_ to separate config prefix and key Dec 20, 2024
Copy link
Member

@SergioGasquez SergioGasquez left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

esp-config cannot be used with esp-hal-embassy
5 participants