All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 " Author: hauleth - https://github.com/hauleth
3 function! ale_linters#elixir#credo#Handle(buffer, lines) abort
4 " Matches patterns line the following:
6 " lib/filename.ex:19:7: F: Pipe chain should start with a raw value.
7 let l:pattern = '\v:(\d+):?(\d+)?: (.): (.+)$'
10 for l:match in ale#util#GetMatches(a:lines, l:pattern)
11 let l:type = l:match[3]
12 let l:text = l:match[4]
14 " Refactoring opportunities
30 \ 'lnum': l:match[1] + 0,
31 \ 'col': l:match[2] + 0,
40 function! ale_linters#elixir#credo#GetMode() abort
41 if get(g:, 'ale_elixir_credo_strict', 0)
48 function! ale_linters#elixir#credo#GetConfigFile() abort
49 let l:config_file = get(g:, 'ale_elixir_credo_config_file', '')
51 if empty(l:config_file)
55 return ' --config-file ' . l:config_file
58 function! ale_linters#elixir#credo#GetCommand(buffer) abort
59 return 'mix help credo && '
60 \ . 'mix credo ' . ale_linters#elixir#credo#GetMode()
61 \ . ale_linters#elixir#credo#GetConfigFile()
62 \ . ' --format=flycheck --read-from-stdin %s'
65 call ale#linter#Define('elixir', {
67 \ 'executable': 'mix',
68 \ 'cwd': function('ale#handlers#elixir#FindMixUmbrellaRoot'),
69 \ 'command': function('ale_linters#elixir#credo#GetCommand'),
70 \ 'callback': 'ale_linters#elixir#credo#Handle',