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:
pmonson711
2025-11-22 06:15:52 -06:00
committed by GitHub
parent 395d9fa2aa
commit 962a932ed4
6 changed files with 56 additions and 1 deletions

View 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'),
\})

View File

@@ -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:

View File

@@ -180,6 +180,7 @@ Notes:
* `dialyxir`
* `dogma`!!
* `elixir-ls`
* `expert`
* `lexical`
* `mix`!!
* Elm

View File

@@ -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|

View File

@@ -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

View 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')