diff options
author | Jon Parise <jon@indelible.org> | 2017-02-22 15:33:05 -0800 |
---|---|---|
committer | w0rp <w0rp@users.noreply.github.com> | 2017-02-22 23:33:05 +0000 |
commit | c2c6c9f4918217a4201b08a62534684be012d2be (patch) | |
tree | 3e80aefbf6f1579fb8927f40e528a60256e8a0ea /ale_linters/elixir | |
parent | fef3276f34d05d30ce6127893816e2afa853023d (diff) | |
download | ale-c2c6c9f4918217a4201b08a62534684be012d2be.zip |
Fix Credo's line-matching pattern (#360)
* Fix Credo's line-matching pattern
In d3e7d3d5, the line matching pattern was changed to handle filenames
other than `stdin`. Unfortunately, this broke the pattern's ability to
reliably extract both line and column numbers because the latter is an
optional match and the filename portion was very greedy. This resulted
in line numbers being discarded (treated as part of the filename) and
column numbers being interpreted as line numbers.
This change simplifies the pattern to only anchor on the line's suffix,
ignoring the filename portion entirely.
Alternatively, we could use vim's `\f` ("file name characters") class,
but that could still run into problems when `:`'s naturally appear in
the filename.
* Add a Vader test case for the Credo handler
Diffstat (limited to 'ale_linters/elixir')
-rw-r--r-- | ale_linters/elixir/credo.vim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ale_linters/elixir/credo.vim b/ale_linters/elixir/credo.vim index 4eb5e4d0..6bf3835d 100644 --- a/ale_linters/elixir/credo.vim +++ b/ale_linters/elixir/credo.vim @@ -4,7 +4,7 @@ function! ale_linters#elixir#credo#Handle(buffer, lines) abort " Matches patterns line the following: " " lib/filename.ex:19:7: F: Pipe chain should start with a raw value. - let l:pattern = '\v^.+:(\d+):?(\d+)?: (.): (.+)$' + let l:pattern = '\v:(\d+):?(\d+)?: (.): (.+)$' let l:output = [] for l:line in a:lines |