Closed Laymer closed 6 years ago
Shouldn't it be possible to use the :warn_on_unnecessary_quotes option somehow to get rid of those warnings?
At the moment of facing the problem I remember that the commit that introduced the option was something like 7 or 9 days old, and since the project I am working on requires a very specific setup, this has been the first solution that I could manage to silence the warnings.
So it's totally possible that I've missed something or that the option has been added in subsequent commits on elixir-lang, so this PR might not be useful anymore.
But since it worked in our case I thought that I would still let you know in case you run into the same issue. Unfortunately my level of Elixir knowledge only brought me so far, and I can't say if this is a correct solution or an ugly hack.
So, turns out that it cannot be done with Code.eval_string, but it can be done using some other function. See https://github.com/elixir-lang/elixir/pull/7838/files#diff-ba2dc6a9a3e9c51bdfd55a2b51510d4e for an example on how to do it properly now.
I put a question regarding this in the PR, so lets see what they say...
I think that José Valim's answer definitely favors #38 and it is fair to assume this PR can be closed. Thank you for providing a solution to this issue ! :)
Hello :slightly_smiling_face:
I have started using rebar3_elixir_compile recently in order to include Elixir dependencies in my applications, and have noticed that there were lots of warnings regarding quoted keywords (cf attached image) after each
rebar3 compile
.I have found out that this warning was implemented in Elixir a few days after I started using the plugin, in response to this issue, and a PR with a commit that produces a warning when a Keyword is constructed as
"key": value
.Since the lock files that are produced by the plugin evaluate code, the warnings are produced for all dependencies and nested dependencies in
mix.lock
files in the_elixir_build
directory. In our case, a solution has been to parse and transform those files before evaluating them so that the evaluated code is compliant with Elixir's (1.7.2) expected syntax.Also, any feedback is very welcome if you think this is perhaps not the way to go :slightly_smiling_face: