bodhilogic

bodhilogic

Phoenix mix warning

I’m creating a new phoenix application (my first time) and I am seeing the following warning when I am using mix phoenix,gen.html to build my DB tables:

warning: found quoted keyword "test" but the quotes are not required. Note that keywords are always atoms, even when quoted, and quotes should only be used to introduce keywords with foreign characters in them mix.exs:57

I realize that the warning has nothing to do with the table building but wonder why Phoenix is generating its own ‘bugs’ (to me, a warning is a bug)? Is it because I am using mix phoenix,gen.html instead of mix phx,gen.html?

Most Liked

idi527

idi527

:waving_hand:

Because the warning comes from elixir 1.7, supposedly (I haven’t seen this warning in elixir 1.6), and phoenix v1.3 was released before elixir 1.7.

The warning is about a keyword list in aliases in your mix.exs. If you check it, you’d see something like

defp aliases do
  [
    # ...
    "test":  #...
  ]
end

there.

The warning says that "test": can safely be replaced with test:.

NobbZ

NobbZ

If it is only possible to create with quotes, it shouldn’t create any warning. If it indeed creates a warning and is not possible without quotes, please file a bug at GitHub - elixir-lang/elixir: Elixir is a dynamic, functional language for building scalable and maintainable applications · GitHub.

edit

For me :"$" doesn’t create a warning. I’m on Elixir 1.7.3 compiled and running on OTP 21.

bodhilogic

bodhilogic

I’ve removed the quotes from the atom but it still moans about the line… my guess is that it doesn’t like the other quoted “test” either, but I assume that is a command parameter that needs to be quoted?

  defp aliases do
    [
      "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
      "ecto.reset": ["ecto.drop", "ecto.setup"],
      test: ["ecto.create --quiet", "ecto.migrate", "test"]
    ]
  end

Where Next?

Popular in Questions Top

New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

Other popular topics Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

We're in Beta

About us Mission Statement