mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 04:34:25 +08:00
add support for expert (#5036)
* add support for expert * Refactor elixir expert linter from feedback - Simplify configuration by removing executable lookup logic - Update documentation to reflect current configuration options - Rename test file and update assertions for the new configuration * default to expert for the lsp The install instructions included something I missed. It includes a global install, where the default executable is just `expert`. I'll default to that and review if I should should add a configuration for a global config. --------- Co-authored-by: Your Name <pmonson711@nfiindustries.com>
This commit is contained in:
12
ale_linters/elixir/expert.vim
Normal file
12
ale_linters/elixir/expert.vim
Normal file
@@ -0,0 +1,12 @@
|
||||
" Author: Paul Monson <pmonson711@pm.me>
|
||||
" Description: Expert integration (https://github.com/elixir-lang/expert)
|
||||
|
||||
call ale#Set('elixir_expert_executable', 'expert')
|
||||
|
||||
call ale#linter#Define('elixir', {
|
||||
\ 'name': 'expert',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'elixir_expert_executable')},
|
||||
\ 'command': '%e',
|
||||
\ 'project_root': function('ale#handlers#elixir#FindMixUmbrellaRoot'),
|
||||
\})
|
||||
@@ -139,8 +139,28 @@ g:ale_elixir_lexical_release
|
||||
|
||||
For example, set release to: `/home/projects/lexical/_build/dev/rel/lexical`
|
||||
|
||||
There are currnetly no configuration options for lexical.
|
||||
There are currently no configuration options for lexical.
|
||||
|
||||
|
||||
===============================================================================
|
||||
expert *ale-elixir-expert*
|
||||
|
||||
Expert (https://github.com/elixir-lang/expert)
|
||||
|
||||
*ale-options.elixir_expert_executable*
|
||||
*g:ale_elixir_expert_executable*
|
||||
*b:ale_elixir_expert_executable*
|
||||
elixir_expert_executable
|
||||
g:ale_elixir_expert_executable
|
||||
Type: |String|
|
||||
Default: `/usr/bin/elixir-expert`
|
||||
|
||||
Location of the expert executable.
|
||||
|
||||
For example, set release to:
|
||||
`/home/projects/expert/apps/expert/burrito_out/expert_linux_amd64`
|
||||
|
||||
There are currently no configuration options for expert.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
@@ -180,6 +180,7 @@ Notes:
|
||||
* `dialyxir`
|
||||
* `dogma`!!
|
||||
* `elixir-ls`
|
||||
* `expert`
|
||||
* `lexical`
|
||||
* `mix`!!
|
||||
* Elm
|
||||
|
||||
@@ -3490,6 +3490,7 @@ documented in additional help files.
|
||||
credo.................................|ale-elixir-credo|
|
||||
cspell................................|ale-elixir-cspell|
|
||||
lexical...............................|ale-elixir-lexical|
|
||||
expert................................|ale-elixir-expert|
|
||||
elm.....................................|ale-elm-options|
|
||||
elm-format............................|ale-elm-elm-format|
|
||||
elm-ls................................|ale-elm-elm-ls|
|
||||
|
||||
@@ -190,6 +190,7 @@ formatting.
|
||||
* [dialyxir](https://github.com/jeremyjh/dialyxir)
|
||||
* [dogma](https://github.com/lpil/dogma) :floppy_disk:
|
||||
* [elixir-ls](https://github.com/elixir-lsp/elixir-ls) :warning: :speech_balloon:
|
||||
* [expert](https://github.com/elixir-lang/expert) :warning: :speech_balloon:
|
||||
* [lexical](https://github.com/lexical-lsp/lexical) :warning: :speech_balloon:
|
||||
* [mix](https://hexdocs.pm/mix/Mix.html) :warning: :floppy_disk:
|
||||
* Elm
|
||||
|
||||
20
test/linter/test_elixir_expert.vader
Normal file
20
test/linter/test_elixir_expert.vader
Normal file
@@ -0,0 +1,20 @@
|
||||
Before:
|
||||
call ale#assert#SetUpLinterTest('elixir', 'expert')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(should set correct defaults):
|
||||
AssertLinter 'expert', ale#Escape('expert')
|
||||
|
||||
Execute(The executable should be configurable):
|
||||
let b:ale_elixir_expert_executable = 'foobar'
|
||||
|
||||
AssertLinter 'foobar', ale#Escape('foobar')
|
||||
|
||||
Execute(should set correct LSP values):
|
||||
call ale#test#SetFilename('../test-files/elixir/umbrella_project/apps/app1/lib/app.ex')
|
||||
|
||||
AssertLSPLanguage 'elixir'
|
||||
AssertLSPOptions {}
|
||||
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/elixir/umbrella_project')
|
||||
Reference in New Issue
Block a user