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
![]()
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
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
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
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #javascript
- #code-sync
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








