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

".credo.exs file does not exist. Ignoring..." (warning)

makarichevss opened this issue · comments

Hi!

I still get ".credo.exs file does not exist. Ignoring..." warning after installing Credo in VS Code on Windows 11 Pro.
The problem is that there is some Credo inspection that requires .credo.exs in the root of the mix project.
Right after I create such file (empty inside), the warning is gone.

Could you please turn off this inspection, so there is no need to create that unnecessary .credo.exs file?

Hi, I'm aware that this is annoying if you don't use a custom linting config. But, I believe that most users would use a custom configuration instead of credo's default one.

You can go into the extension settings and ignore this warning. Or you can specify it in your settings JSON: "elixir.credo.ignoreWarningMessages": true

see this issue: #4 (comment)

I also encountered this. It would be good if the error was updated to suggest creating a file, e.g. via mix credo gen.config. That would save users googling and finding this page.

Yes, from my point of view the best solution would be not to mask this bug or ask users to solve it manually, but offer some automatic fix.

The option we are discussing is adding "elixir.credo.ignoreWarningMessages": true. Is it really the solution to ignore all warning messages from credo (that's what will be if you add this option)? You'll just ignore all warning messages from credo. What if there are some useful ones? If I turn off all warnings, some useful messages would be ignored as well.

I think the best solution would be that credo automatically offers to create the necessary file if it's absent. If I accept this offer, the file is created. And if I decline that offer, only that warning is ignored (but all other warnings should be active).

@makarichevss I agree. The best solution would be to show a notification that you use the default credo config if no config file is present. Then you can either click on "Generate Config" (that runs mix credo gen.config or "Ignore" which only ignores this type of warning message (not the rest).

The present config to ignore all warning messages was more of a dirty temporary fix 😄

I was getting ".credo.exs does not exist" even though it is right there in the root of the umbrella app. Then I realized it should be within each of the apps in the umbrella, so I symlinked to it. Maybe there could be a hint to do that?