summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-12-20 10:46:08 +0000
committerw0rp <devw0rp@gmail.com>2017-12-20 10:46:08 +0000
commit87ffc9b55ca9f6aa3ca8acc2babeb26cf2a78b51 (patch)
treeb7f857f80fc54c11e6c2abf7c345a40fdc118599
parentd4b43d23f4a9f277a482fdad4ea3a3e951d80eab (diff)
downloadale-87ffc9b55ca9f6aa3ca8acc2babeb26cf2a78b51.zip
Make the error codes configurable for gitlint
-rw-r--r--ale_linters/gitcommit/gitlint.vim3
-rw-r--r--test/handler/test_gitlint_handler.vader12
2 files changed, 10 insertions, 5 deletions
diff --git a/ale_linters/gitcommit/gitlint.vim b/ale_linters/gitcommit/gitlint.vim
index 991d5a1a..49aeda7c 100644
--- a/ale_linters/gitcommit/gitlint.vim
+++ b/ale_linters/gitcommit/gitlint.vim
@@ -30,7 +30,8 @@ function! ale_linters#gitcommit#gitlint#Handle(buffer, lines) abort
let l:item = {
\ 'lnum': l:match[1] + 0,
- \ 'text': l:code . ': ' . l:match[3],
+ \ 'text': l:match[3],
+ \ 'code': l:code,
\ 'type': 'E',
\}
diff --git a/test/handler/test_gitlint_handler.vader b/test/handler/test_gitlint_handler.vader
index 58f5e67d..73ee988f 100644
--- a/test/handler/test_gitlint_handler.vader
+++ b/test/handler/test_gitlint_handler.vader
@@ -10,22 +10,26 @@ Execute(The gitlint handler should handle basic warnings and syntax errors):
\ {
\ 'lnum': 1,
\ 'type': 'E',
- \ 'text': 'B6: Body message is missing',
+ \ 'text': 'Body message is missing',
+ \ 'code': 'B6',
\ },
\ {
\ 'lnum': 2,
\ 'type': 'E',
- \ 'text': 'B4: Second line is not empty: "to send to upstream"',
+ \ 'text': 'Second line is not empty: "to send to upstream"',
+ \ 'code': 'B4',
\ },
\ {
\ 'lnum': 3,
\ 'type': 'E',
- \ 'text': 'B5: Body message is too short (19<20): "to send to upstream"',
+ \ 'text': 'Body message is too short (19<20): "to send to upstream"',
+ \ 'code': 'B5',
\ },
\ {
\ 'lnum': 8,
\ 'type': 'E',
- \ 'text': 'T1: Title exceeds max length (92>72): "some very long commit subject line where the author can''t wait to explain what he just fixed"'
+ \ 'text': 'Title exceeds max length (92>72): "some very long commit subject line where the author can''t wait to explain what he just fixed"',
+ \ 'code': 'T1',
\ },
\ ],
\ ale_linters#gitcommit#gitlint#Handle(1, [