bodhilogic

bodhilogic

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?

Showing Posts 1 to 10

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:.

bodhilogic

bodhilogic OP

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
idi527

idi527

No, the other "test" is supposed to be quoted and is not the reason for the warning. I don’t have any warnings once I replace "test": with test:.

bodhilogic

bodhilogic OP

FYI: The error (warning) eventually went away on its own - after about half a day of ignoring it!?!?

sheharyarn

sheharyarn

Is there a way to hide the warning without changing it?

NobbZ

NobbZ

Downgrading elixir to some version before the warning was introduced.

sheharyarn

sheharyarn

Lol, obviously I meant something other than that. But I guess that means it’s not possible. Thanks.

NobbZ

NobbZ

Well, warnings are printed to be acted on, there is currently no way to silence them besides changing the code accordingly or to change to a version of elixir that does not emit the warnings.

And I really hope, there will never be a way to silence the warnings, that would totally defeat their purpose.

sheharyarn

sheharyarn

I think I should be able to write :"something" without the compiler constantly throwing warning messages at me :joy:

Jokes aside, I don’t believe all warnings are equally important, especially in this case. There should be a way to tell the compiler “I know what I’m doing” so it can suppress specific warnings.

amnu3387

amnu3387

It also shows warnings when using :"..." inside an :ets.match - I don’t think you can write it in any other way there.

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New
ChrisAmelia
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication): toke...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews