-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Hi, originally I wanted to place it in mailing lists as proposition, but found that's more like bug, because it does not work as same as before Elixir release 1.9.0.
First of all this does not produces any compile-time warning:
ecto/lib/mix/tasks/ecto.gen.repo.ex
Lines 85 to 93 in c0d3906
| embed_template :config, """ | |
| use Mix.Config | |
| config <%= inspect @app %>, <%= inspect @mod %>, | |
| database: "<%= @app %>_<%= @base %>", | |
| username: "user", | |
| password: "pass", | |
| hostname: "localhost" | |
| """ |
I believe that typical beginner may not even correct this. Just btw. I would like to ask if we should add warning in
Mix.Config.__using__/1 macro.
The bigger problem is here:
ecto/lib/mix/tasks/ecto.gen.repo.ex
Lines 54 to 55 in c0d3906
| File.write! "config/config.exs", | |
| String.replace(contents, "use Mix.Config\n", config_template(opts)) |
If we would have
import Config then repo configuration would just not be added - this part looks like a bug for me as general behavior (adding config) is changed (not working as expected).
I suggest to add check like:
Version.match? "1.9.0", Mix.Project.config()[:elixir]and store first config line in a variable.
Is it ok to make PR for this one right now or it should be discussed on mailing lists before it?
Metadata
Metadata
Assignees
Labels
No labels