-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Improve documentation for Mix.env #6308
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
Conversation
lib/mix/lib/mix.ex
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The usual wording is something like
This function should not be used at runtime (see
env/0for more information).
lib/mix/lib/mix.ex
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is too much information because most of it is duplicated (from import_config/1 for example). I would say something like:
This function should not be used at runtime. Mix is a build tool and may not be available after the code is compiled (for example in a release).
To differentiate runtime behaviour depending on the environment, it's recommended to use application environment (see
Application.get_env/3). Proper configuration can be set inMix.Configfiles, often per-environment (seeMix.Config.import_config/1for more information).
Wdyt?
|
I think we should rethink our use of "runtime" because it is perfectly fine to use |
|
What about something like this?
|
Sounds good to me (Mix capitalized and trailing period assumed 😄). |
|
Updated |
|
Thanks @michalmuskala! 💟 |
No description provided.