From 962a932ed43417f4fbcb32d8145ecf90098a6237 Mon Sep 17 00:00:00 2001 From: pmonson711 <4119175+pmonson711@users.noreply.github.com> Date: Sat, 22 Nov 2025 06:15:52 -0600 Subject: [PATCH] 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 --- ale_linters/elixir/expert.vim | 12 ++++++++++++ doc/ale-elixir.txt | 22 +++++++++++++++++++++- doc/ale-supported-languages-and-tools.txt | 1 + doc/ale.txt | 1 + supported-tools.md | 1 + test/linter/test_elixir_expert.vader | 20 ++++++++++++++++++++ 6 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 ale_linters/elixir/expert.vim create mode 100644 test/linter/test_elixir_expert.vader diff --git a/ale_linters/elixir/expert.vim b/ale_linters/elixir/expert.vim new file mode 100644 index 00000000..aba88ab0 --- /dev/null +++ b/ale_linters/elixir/expert.vim @@ -0,0 +1,12 @@ +" Author: Paul Monson +" 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'), +\}) diff --git a/doc/ale-elixir.txt b/doc/ale-elixir.txt index a4cbf309..224a100f 100644 --- a/doc/ale-elixir.txt +++ b/doc/ale-elixir.txt @@ -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: diff --git a/doc/ale-supported-languages-and-tools.txt b/doc/ale-supported-languages-and-tools.txt index 43c7821a..5c3e3e54 100644 --- a/doc/ale-supported-languages-and-tools.txt +++ b/doc/ale-supported-languages-and-tools.txt @@ -180,6 +180,7 @@ Notes: * `dialyxir` * `dogma`!! * `elixir-ls` + * `expert` * `lexical` * `mix`!! * Elm diff --git a/doc/ale.txt b/doc/ale.txt index 5d0a6161..da9bd7fe 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -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| diff --git a/supported-tools.md b/supported-tools.md index 691c5e62..74cf59f0 100644 --- a/supported-tools.md +++ b/supported-tools.md @@ -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 diff --git a/test/linter/test_elixir_expert.vader b/test/linter/test_elixir_expert.vader new file mode 100644 index 00000000..a36f4e47 --- /dev/null +++ b/test/linter/test_elixir_expert.vader @@ -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')