Mix compile "absolute" path in umbrella apps

Hi,

When we run a mix compile in an umbrella app, we have the following output:

==> app_name
Compiling 1 file (.ex)
warning: an error message
  web/controllers/my_controller.ex:4

The path is relative from the umbrella application (i.e: app_name) instead of the root application.

It’s a problem for me because I can’t make my linter works properly with mix compile :sweat_smile:. On dogma and credo it works well because they use a path from the root application.

[R] ↓ Line is too long (max is 120, was 126).
┃       apps/app_name/web/controllers/my_controller.ex:5:121 (AppName.MyController.show)

Is there any reason to have this path relative to the child application? Do you know if there are a mix option to output an “absolute” path or if it’s a behaviour we could change in future releases?

Thanks for your help :slight_smile:

The reason why it is a relative path is because mix compile is defined as a recursive task. So it literally changes the directory to inside each application and then compile its code.

2 Likes

Thanks for the reply @josevalim I now understand why it’s relative - I didn’t know about the recursive attribute on Mix.

I will try to hack something on my editor to prepend the path returned by Elixir to my project path in order to build a link I can follow.

Thanks