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

Chore: warning: Application.get_env/2 discouraged in module body, use Application.compile_env/3 #30

Open
nelsonic opened this issue Nov 10, 2022 · 1 comment
Labels
chore a tedious but necessary task often paying technical debt discuss Share your constructive thoughts on how to make progress with this issue enhancement help wanted priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished T25m Time Estimate 25 Minutes

Comments

@nelsonic
Copy link
Member

Getting the following warnings when compiling the MVP project:

warning: Application.get_env/3 is discouraged in the module body, use Application.compile_env/3 instead
  lib/plug/conn/status.ex:6: Plug.Conn.Status

warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead
  lib/plug/mime.ex:4: Plug.MIME

warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead
  lib/auth_plug.ex:22: AuthPlug

The last one is related to AuthPlug which we "control". So we should update our code.
This means we have an opportunity to create an Envar.compile_env/3 function
that proxies Application.compile_env/3 but enhances it for usability.

@nelsonic nelsonic added enhancement help wanted chore a tedious but necessary task often paying technical debt discuss Share your constructive thoughts on how to make progress with this issue T25m Time Estimate 25 Minutes priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished labels Nov 10, 2022
@nelsonic nelsonic changed the title warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead lib/auth_plug.ex:22: AuthPlug Chore: warning: Application.get_env/2 discouraged in module body, use Application.compile_env/3 Nov 10, 2022
@nelsonic
Copy link
Member Author

Application.compile_env/3 https://hexdocs.pm/elixir/main/Application.html#compile_env/3 requires the env e.g: :my_app as the first parameter ... 🤦‍♂️
I understand why they are doing this, but it's lame for us. 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore a tedious but necessary task often paying technical debt discuss Share your constructive thoughts on how to make progress with this issue enhancement help wanted priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished T25m Time Estimate 25 Minutes
Projects
None yet
Development

No branches or pull requests

1 participant