From d3e7d3d5e794dbce9802733a2bcc25e01f82b92b Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Thu, 9 Feb 2017 19:15:49 -0800 Subject: Pass the buffer's filename to Credo By default, Credo attributes input from STDIN as though it came from a file named `stdin`. This change passes the buffer's filename, too, so that Credo can use that information when applying its configuration. This is a nice improvement because files like `mix.exs` are normally excluded from Credo-based linting. Previously, ALE would show lint warnings for those files as they were edited. Now, they are correctly honor the Credo configuration and don't produce lint output. --- ale_linters/elixir/credo.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ale_linters/elixir/credo.vim') diff --git a/ale_linters/elixir/credo.vim b/ale_linters/elixir/credo.vim index f79106d9..4eb5e4d0 100644 --- a/ale_linters/elixir/credo.vim +++ b/ale_linters/elixir/credo.vim @@ -3,8 +3,8 @@ function! ale_linters#elixir#credo#Handle(buffer, lines) abort " Matches patterns line the following: " - " stdin:19: F: Pipe chain should start with a raw value. - let l:pattern = '\v^stdin:(\d+):?(\d+)?: (.): (.+)$' + " lib/filename.ex:19:7: F: Pipe chain should start with a raw value. + let l:pattern = '\v^.+:(\d+):?(\d+)?: (.): (.+)$' let l:output = [] for l:line in a:lines @@ -41,5 +41,5 @@ endfunction call ale#linter#Define('elixir', { \ 'name': 'credo', \ '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' }) -- cgit v1.2.3