elixir-lang / elixir

Elixir is a dynamic, functional language for building scalable and maintainable applications
https://elixir-lang.org/
Apache License 2.0
24.51k stars 3.38k forks source link

Bug: import_dependency not working #7180

Closed mumughal closed 6 years ago

mumughal commented 6 years ago

Environment

Current behavior

When I try to import formatter from dependency, it doesn't seem to work. I have tried with espec formatter and a clean project. I have created this new repository to test with clean project, still it doesn't seem to work.

Expected behavior

Formatter should be able to import rules from the dependency and apply the rules on the files.

Please look into this code: test-repository

josevalim commented 6 years ago

Thanks for the report with a mechanism to reproduce the issue. :heart: I am looking into this now.

josevalim commented 6 years ago

@mumughal I was able to format it just fine. Here is the file I got after formatting:

defmodule TestFormatSpec do
  @moduledoc "Tests for controller"
  use ESpec.Phoenix, async: false

  let conn: build_conn()
  let response: subject()

  let body: response().resp_body
  let json: Poison.decode!(body())
  let status: response().status

  describe "/index" do
    subject do: get(conn(), "/index")

    it "should return status code 200" do
      expect(status() |> to(eq 200))
    end
  end
end

Note parens were not added to it, subject, let and friends.

What were you expecting to happen?

mumughal commented 6 years ago

I was working with Elixir 1.6.0-dev. I just upgraded to version 1.7.0-dev and now it works! :)

Thank you so much for looking into it.

josevalim commented 6 years ago

Glad to hear!