dwyl / dwyl/github-backup

elixir-formatter is displaying an error on save

Đang mở
#128 0 bình luận 1 reaction 1 người được giao Được @RobStallion nhận Xem trên GitHub
discuss priority-4 technical
Ngôn ngữ chính
Elixir
Star
33
Fork
3
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

![image](https://user-images.githubusercontent.com/15571853/49509301-d18b4a80-f87c-11e8-80a5-7f62ea51c508.png)

However, this is causing the following error...

![image](https://user-images.githubusercontent.com/15571853/49509632-d0a6e880-f87d-11e8-9ccf-9a8de5b11c8b.png)

This line causing the issue is...
```elixir
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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.