pantajoe / vscode-elixir-credo

VSCode support for Elixir Linter 'Credo'.
https://marketplace.visualstudio.com/items?itemName=pantajoe.vscode-elixir-credo
MIT License
28 stars 7 forks source link
credo elixir linter vscode-extension

VS Code Credo (Elixir Linter)

GitHub Workflow Status Visual Studio Marketplace Downloads Open VSX Downloads The MIT License

This VS Code extension provides display of the output of the static code analysis tool Credo for the programming language Elixir.

Features

Demo

Requirements

Add the Elixir linter Credo to your dependencies in your project's mix.exs file and install it by running mix deps.get.

Extension Settings

This extension contributes the following settings:

Troubleshooting

"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.

".credo.exs does not exist. Ignoring..."

You will probably want the extension to look for your custom Credo configuration files. If you are working on an umbrella Mix application, having .credo.exs only in the root of your app is not enough; the file needs to be present in each app covered by the umbrella.

If you want your root configuration to apply equally to all child apps, then you can create a symbolic link to it within each app by running the following from the root directory of your umbrella:

$ for dir in apps/*; do ln -s ../../.credo.exs "$dir/.credo.exs"; done

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.

Changelog

See Changelog

Contribution

When contributing, please refer to the Contribution Guide

License

This software is released under the MIT License.

© 2020-2022 Joe Pantazidis