pantajoe / vscode-elixir-credo

VSCode support for Elixir Linter 'Credo'.

Home Page:https://marketplace.visualstudio.com/items?itemName=pantajoe.vscode-elixir-credo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't find the right root folder on multi-apps projects

ZeLarpMaster opened this issue · comments

Hello! I've seen #289 and have a similar issue, but the proposed solution would not work for me.

My project folder is structured as the following:

  • mix.exs (with credo installed here)
  • .credo.exs
  • apps/
    • app_foo (with its own mix.exs without credo)
    • app_bar (with its own mix.exs without credo)
    • and many more apps structured similarly

So I have many apps, but I want consistency in the whole codebase. So installing credo in every mix.exs doesn't work and having a .credo.exs in every app doesn't either.

But when I'm editing files in any of the apps, the extension finds the mix.exs in the file's app, uses that folder as the project folder, and doesn't find credo installed because it's further up.

For now I'm working around this by modifying the extension code manually so it searches for ".credo.exs" instead of "mix.exs", but I could see this not working for other projects. I think having a configuration to manually specify the project folder would help fix the times where the automatic discovery doesn't work as needed.

commented

This fix worked for me as well. Any way we can get this done by default?

I'm currently swamped with personal and work stuff, but I'm hoping to be able to attend to this at the end of this month latest.

In #289, another person mentioned that they symlinked the .credo.exs in each directory of the umbrella project. Is this something you would consider?

I'm not very active in Elixir ATM, so I don't know whether that's a recommended way in Elixir projects or not.

I don't know about recommended, but that's certainly something I can do in my case. I didn't think of that. Thanks!