Mix compile warnings-as-errors

281 views
Skip to first unread message

Chris Jimison

unread,
Feb 23, 2015, 7:33:36 PM2/23/15
to elixir-l...@googlegroups.com
Hi all,

Kind of a dumb question but I hit a bit of road block on this one and any help would be greatly appreciated.  

I would like to set up mix so that warnings are treated as errors.  I saw in Mix.Tasks.Compile.Elixir there is a flag I can pass in --warnings-as-errors but I can' figure out how to make this work.  

I tried on the command line: mix compile --warnings-as-errors, but I am seeing the same warnings with no errors.

In my mix.exs file I also have the following defined:

  def project do
    [app: :sandbox,
     version: "0.0.1",
     deps_path: "../../deps",
     lockfile: "../../mix.lock",
     elixir: "~> 1.0",
     erlc_options: [{:parse_transform, :lager_transform}, :warn_missing_spec, :warnings_as_errors],
     deps: deps]
  end

which works exactly as expected for my erlang files.  So with all that stated here are my questions:

Is there something similar to erlc_options for the elixir files?
Is there a flag for warn on missing spec like in Erlang?

Thanks again for any help and/or insight!

-chris

José Valim

unread,
Feb 24, 2015, 2:47:04 AM2/24/15
to elixir-l...@googlegroups.com
Which warnings are you seeing not as an error?

In any case, you can elixirc_options: [warnings_as_errors: true].



José Valim
Skype: jv.ptec
Founder and Lead Developer

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/da56306f-ecf3-4df2-9e9e-50e4d59310a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christopher Jimison

unread,
Feb 24, 2015, 3:15:56 AM2/24/15
to elixir-l...@googlegroups.com
The warnings I was not seeing as an error is “variable xyz is unused”. 

Also adding the below field into the mix.exs "def project" did not fix the issue and I am still seeing warnings with no errors generated.

I am on elixir 1.0.3 if that helps any.

Thanks!

You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-core" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-core/8r8K8FA7i00/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4JGLCTcLg05dh6pS3zxSpFku42ir4Chn1XTXrEr%2BMxSoA%40mail.gmail.com.

José Valim

unread,
Feb 24, 2015, 3:21:07 AM2/24/15
to elixir-l...@googlegroups.com
Please report that as an issue then, it looks like a bug. :)



José Valim
Skype: jv.ptec
Founder and Lead Developer

Christopher Jimison

unread,
Feb 24, 2015, 3:26:07 AM2/24/15
to elixir-l...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages