mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 20:54:26 +08:00
Make the error codes configurable for gitlint
This commit is contained in:
@@ -30,7 +30,8 @@ function! ale_linters#gitcommit#gitlint#Handle(buffer, lines) abort
|
|||||||
|
|
||||||
let l:item = {
|
let l:item = {
|
||||||
\ 'lnum': l:match[1] + 0,
|
\ 'lnum': l:match[1] + 0,
|
||||||
\ 'text': l:code . ': ' . l:match[3],
|
\ 'text': l:match[3],
|
||||||
|
\ 'code': l:code,
|
||||||
\ 'type': 'E',
|
\ 'type': 'E',
|
||||||
\}
|
\}
|
||||||
|
|
||||||
|
|||||||
@@ -10,22 +10,26 @@ Execute(The gitlint handler should handle basic warnings and syntax errors):
|
|||||||
\ {
|
\ {
|
||||||
\ 'lnum': 1,
|
\ 'lnum': 1,
|
||||||
\ 'type': 'E',
|
\ 'type': 'E',
|
||||||
\ 'text': 'B6: Body message is missing',
|
\ 'text': 'Body message is missing',
|
||||||
|
\ 'code': 'B6',
|
||||||
\ },
|
\ },
|
||||||
\ {
|
\ {
|
||||||
\ 'lnum': 2,
|
\ 'lnum': 2,
|
||||||
\ 'type': 'E',
|
\ '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,
|
\ 'lnum': 3,
|
||||||
\ 'type': 'E',
|
\ '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,
|
\ 'lnum': 8,
|
||||||
\ 'type': 'E',
|
\ '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, [
|
\ ale_linters#gitcommit#gitlint#Handle(1, [
|
||||||
|
|||||||
Reference in New Issue
Block a user