elixir-formatter is displaying an error on save

Open
#128 0 comments 1 reaction 1 assignee View on GitHub

@RobStallion is already working on this.

Since Dec 5, 2018.

Assessment

This issue has not been assessed yet.

Description

discuss priority-4 technical

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.

Dominant language
Elixir
Stars
33
Forks
3
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dwyl/github-backup

All issues in dwyl/github-backup

Similar issues

More Elixir issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.