how to run linters for elixir? #4977
Replies: 2 comments
-
nevermind. even with rebar3 on the "right" place i still get return code 1 for the mix format line followed by the elixir-ls/language_server.sh failure. Same as the original comment above. |
Beta Was this translation helpful? Give feedback.
-
I wrote my first ever elixir code during the past weekend, so I'm far from an expert. As no one else has answered I figure it might still be a good idea to write. Firstly, it has been a while since your post. Did you manage to resolve it? Us rustaceans are a bit spoiled with tooling. Not only with rust-analyzer. I believe the elixir equivalent of clippy is this guide on anti-patterns which one needs to learn and apply manually. Hopefully I'm wrong about that! My impression, but I am shooting a bit from the hip here, is that elixir linters tend to expect being installed for each project with mix rather than as system-wide (or even user-wide as with rustup) tools. Thus with every user's environment different, integration with tools such as ale gets slightly more challenging. Does running mix in the shell work as expected, or does it return 1 there too? In order to avoid the errors for undesired tools, you could set let g:ale_linters = { 'elixir': ['mix'] } or perhaps more realistically: autocmd FileType elixir let b:ale_linters = { 'elixir': [ 'mix'] } I got the impression that elixir-ls and lexical are quite okay, but your choices are yours. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
coming from rust, i simply enable analyzer as a linter and see:
(started) ['/bin/bash', '-c', '''rust-analyzer''']
but on elixir, the
mix
linter does nothing (generate no commands) and even things like format fails without a LS.is there a guide for a linter/formatter without LS for elixir? the :help ale-elixir only list global variables, but doesn't goes into integration details like other help files
Beta Was this translation helpful? Give feedback.
All reactions