dwyl / github-backup

:octocat: :back: 🆙 Backup your GitHub Issues so you can still work when (they/you are) offline.
https://github-backup.herokuapp.com
GNU General Public License v2.0
31 stars 3 forks source link

elixir-formatter is displaying an error on save #128

Open RobStallion opened 5 years ago

RobStallion commented 5 years ago

With phoenix version 1.4 came the inclusion of the formatter...

image

However, this is causing the following error...

image

This line causing the issue is...

  url: [host: Map.fetch!(System.get_env(), "APP_HOST")],

in the config file.

This seems to be happening because the formatter has not got access to env variables that the app would when the application is compiled (assuming you have sourced your .env file of course).

There may be a simple solution to this issue that allows us to both format on save but also keep the safety that the Map.fetch! syntax provides (it does not allow you to run the app if you have not set an env file that is needed in the applicaton (VERY VERY HELPFUL for people like me who forget to source envs far too often).

Haven't looking into solution yet. Just wanted to capture this issue for now.