Merge pull request #327 from jparise/credo-stdin-filename

Pass the buffer's filename to Credo
This commit is contained in:
w0rp 2017-02-10 09:20:45 +00:00 committed by GitHub
commit 5bda827143

View file

@ -3,8 +3,8 @@
function! ale_linters#elixir#credo#Handle(buffer, lines) abort function! ale_linters#elixir#credo#Handle(buffer, lines) abort
" Matches patterns line the following: " Matches patterns line the following:
" "
" stdin:19: F: Pipe chain should start with a raw value. " lib/filename.ex:19:7: F: Pipe chain should start with a raw value.
let l:pattern = '\v^stdin:(\d+):?(\d+)?: (.): (.+)$' let l:pattern = '\v^.+:(\d+):?(\d+)?: (.): (.+)$'
let l:output = [] let l:output = []
for l:line in a:lines for l:line in a:lines
@ -41,5 +41,5 @@ endfunction
call ale#linter#Define('elixir', { call ale#linter#Define('elixir', {
\ 'name': 'credo', \ 'name': 'credo',
\ 'executable': 'mix', \ 'executable': 'mix',
\ 'command': 'mix credo suggest --format=flycheck --read-from-stdin', \ 'command': 'mix credo suggest --format=flycheck --read-from-stdin %s',
\ 'callback': 'ale_linters#elixir#credo#Handle' }) \ 'callback': 'ale_linters#elixir#credo#Handle' })