VSCode support for Elixir Linter 'Credo'.
This VS Code extension provides display of the output of the static code analysis tool Credo for the programming language Elixir.
mix
binaryAdd the Elixir linter Credo to your dependencies in your project's mix.exs
file
and install it by running mix deps.get
.
This extension contributes the following settings:
elixir.credo.configurationFile
: location of the configuration file Credo should use. Can be an absolute path, a relative path or simply a file.elixir.credo.credoConfiguration
: name of the configuration Credo should use. Uses the default configuration per default (default
).elixir.credo.strictMode
: whether to utilize Credo's strict mode when linting.elixir.credo.executePath
: execute path of the mix
executableelixir.credo.checksWithTag
: specify tags of those checks which should be used in VS Code (all other checks will be ignored)elixir.credo.checksWithoutTag
: specify tags of checks which should be ignored in VS Codeelixir.credo.ignoreWarningMessages
: ignore warning messages (concerning finding the configuration file)elixir.credo.lintEverything
: lint any elixir file (even if excluded in the Credo configuration file)elixir.credo.enableDebug
: toggle extensive logging to extension's output channelelixir.credo.diffMode.enabled
: enable Credo's diff modeelixir.credo.diffMode.mergeBase
: specify the merge base for the diff mode"The
mix
binary is not executable."
If this warning pops up, the vscode extension's credo child process does not have the path of the mix binary in its PATH
.
Thus, try to set the correct path of the mix
binary in the configuration's settings under "elixir.credo.executePath"
(Elixir > Credo > Execute Path).
"Command
/bin/mix credo
returns empty output!"
This message indicates that the extension cannot get an output from Credo. The problem could be caused by:
First make sure Credo is installed and that Credo has the dependencies installed locally it requires to function. Install them to local archive by running the following commands.
mix archive.install hex credo
mix archive.install hex bunt
mix archive.install hex jason
Then try to generate .credo.exs
for your project by running mix credo gen.config
in your project's root folder.
If this step fails the output could tell you the exact reason for the failure. The problem can be something as simple as a minor syntax error in your config/dev.exs
.
Hint:
Sometimes, any problem you might have is caused by VS Code not having the same PATH
environment variable as your shell.
To make sure VS Code has the same environment as your shell,
simply close all VS Code processes and open VS Code from you command line by executing the binary code
in your shell of choice.
See Changelog
When contributing, please refer to the Contribution Guide
This software is released under the MIT License.
© 2020-2022 Joe Pantazidis