Elixir & Erlang versions (elixir --version):
Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]
Elixir 1.6.1 (compiled with OTP 20)
Operating system: Linux (Fedora 26)
When I try to run mix format with an import_deps containing a Git dependency, it fails:
** (Mix) Unknown dependency :mock_uart given to :import_deps in the formatter configuration. The dependency is not listed in your mix.exs file
In my mix.exs, I have:
{:mock_uart, git: "http://<some_internal_address>/mock_uart.git", tag: "v0.1.0", only: :test}
mix format should work as with Hex dependencies.
Just too double check. Does it also happen after you run mix deps.get?
Just too double check. Does it also happen after you run
mix deps.get?
Yes, I鈥檝e even run mix deps.clean --all, then mix deps.get to be sure.
I wasn't able to reproduce this on Elixir master with {:ecto, github: "elixir-ecto/ecto"}.
I think the problem is that your dependency has only: :test which means it's not available in the default :dev environment which is used when doing mix format. I think if you change the dep to be only: [:dev, :test] it should work.
Good catch @wojtekmach. I will include the environment in the error message.
Most helpful comment
Yes, I鈥檝e even run
mix deps.clean --all, thenmix deps.getto be sure.