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

Getting “found multiple” message all the time

halostatue opened this issue · comments

Found multiple files (./.credo.exs,/Users/austin/dev/kinetic/lowes/.credo.exs) will use ./.credo.exs

Those are the same file (it also applied when I was using the default, .credo.exs).

Hey!

Your comment is much appreciated. However, it seems I cannot replicate this bug. I tried both using ./.credo.exs and .credo.exs, and I did not get any warning message. Can you show me your other config for this extension? And do you have a saved workspace, an opened folder or an added folder to an unsaved workspace when these warning show up?

I’m using an opened folder. I don’t use workspaces (I don’t find that workspaces, um, work for the projects I use at this point). The configuration I have (and have seen this multiple times in a single session) in .vscode/settings.json:

{
  …
  "elixir.credo.executePath": "~/.kiex/elixirs/elixir-1.10.4/bin",
  "elixir.credo.credoConfiguration": "vscode",
}

It’s not showing any configuration for .config.exs, but that’s because I switched it back to the defaults.

As a side note, it may be worth looking at your output capture, because I’ve also gotten errors that the output isn’t JSON if a dependency needs to be recompiled.

Okay, thanks for your input on capturing the JSON output from credo properly. I'll have a quick fix ready today.
Sadly, I still cannot reproduce the bug where you always get the notification that multiple configuration files are found.
I'll add a setting where you can disable this specific "warning" message, so it won't bother you or anyone else having this issue anymore. 😄
I'll let you know as soon as it's ready.

@halostatue, I added (and published) a new configuration option called "elixir.credo.ignoreWarningMessages" that only ignores warning messages concerned with finding the configuration file.
You should be fine by adding "elixir.credo.ignoreWarningMessages": true to your .vscode/settings.json.
Let me now if this serves your purpose of not being annoyed to death 😄

@robsonpeixoto Interesting. After cloning your repository and running mix deps.get && mix compile, the extension and credo seem to run fine without any warning messages. 🤔

Which OS do you use? And what are your VS Code Config starting with `"elixir.credo..." in your Settings JSON?

I'm using the default config.

VSCode version:

Version: 1.55.2
Commit: 3c4e3df9e89829dce27b7b5c24508306b151f30d
Date: 2021-04-13T09:36:32.643Z (3 wks ago)
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Darwin x64 20.4.0

Elixir version:

❯ brew info elixir       
elixir: stable 1.11.4 (bottled), HEAD
Functional metaprogramming aware language built on Erlang VM
https://elixir-lang.org/
/usr/local/Cellar/elixir/1.11.4 (433 files, 6.1MB) *
  Poured from bottle on 2021-03-16 at 13:13:26
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/elixir.rb
License: Apache-2.0
==> Dependencies
Required: erlang ✔
==> Options
--HEAD
        Install HEAD version
==> Analytics
install: 8,244 (30 days), 27,550 (90 days), 102,658 (365 days)
install-on-request: 8,240 (30 days), 27,515 (90 days), 100,742 (365 days)
build-error: 0 (30 days)

Erlang:

❯ brew info erlang 
erlang: stable 23.3.2 (bottled), HEAD
Programming language for highly scalable real-time systems
https://www.erlang.org/
/usr/local/Cellar/erlang/23.3.2 (8,018 files, 461.5MB) *
  Poured from bottle on 2021-04-27 at 20:08:13
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/erlang.rb
License: Apache-2.0
==> Dependencies
Build: autoconf ✔, automake ✔, libtool ✔
Required: openssl@1.1 ✔, wxmac ✔
==> Options
--HEAD
        Install HEAD version
==> Caveats
Man pages can be found in:
  /usr/local/opt/erlang/lib/erlang/man

Access them with `erl -man`, or add this directory to MANPATH.
==> Analytics
install: 31,521 (30 days), 107,744 (90 days), 364,967 (365 days)
install-on-request: 16,320 (30 days), 52,121 (90 days), 148,875 (365 days)
build-error: 0 (30 days)

Hm, okay. Can you activate the extensions's debug mode by setting "elixir.credo.enableDebug" to true, then open your folder and an elixir file and then show me the output of the Output Channel named Elixir Linter (Credo)?
That'd be great!

OUTPUT:

> Found multiple files (.credo.exs,/Users/robinho/Study/study-elixir-kv/.credo.exs) will use .credo.exs

> Retreiving credo information: Executing credo command `/usr/local/bin/mix credo info --format json --verbose` for '/Users/robinho/Study/study-elixir-kv/lib/kv.ex' in directory '/Users/robinho/Study/study-elixir-kv'

> Elixir Linter (Credo) initiated successfully.

> Executing credo command `/usr/local/bin/mix credo --format json --read-from-stdin --config-file .credo.exs --config-name default` for '/Users/robinho/Study/study-elixir-kv/lib/kv.ex' in directory '/Users/robinho/Study/study-elixir-kv'

> Setting linter issues for document '/Users/robinho/Study/study-elixir-kv/lib/kv.ex'.

@robsonpeixoto Thanks a lot! 🙏🏼 I believe I found the issue. Until I have a fix ready, you may activate the extension's option "elixir.credo.ignoreWarningMessages", so you won't get bothered by any more warning messages.

I just released a new version where this issue should be resolved for good.
It always uses the correct workspace folder's configuration folder regardless of how many are opened.
Absolute paths for the credo configuration file are still possible!