Add support for linting git commit message files (#1233)

This commit is contained in:
Nick Diego Yamane
2017-12-20 06:10:07 -04:00
committed by w0rp
parent 1568bf8128
commit d4b43d23f4
10 changed files with 218 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
Before:
runtime ale_linters/gitcommit/gitlint.vim
After:
call ale#linter#Reset()
Execute(The gitlint handler should handle basic warnings and syntax errors):
AssertEqual
\ [
\ {
\ 'lnum': 1,
\ 'type': 'E',
\ 'text': 'B6: Body message is missing',
\ },
\ {
\ 'lnum': 2,
\ 'type': 'E',
\ 'text': 'B4: Second line is not empty: "to send to upstream"',
\ },
\ {
\ 'lnum': 3,
\ 'type': 'E',
\ 'text': 'B5: Body message is too short (19<20): "to send to upstream"',
\ },
\ {
\ '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"'
\ },
\ ],
\ ale_linters#gitcommit#gitlint#Handle(1, [
\ '1: B6 Body message is missing',
\ '2: B4 Second line is not empty: "to send to upstream"',
\ '3: B5 Body message is too short (19<20): "to send to upstream"',
\ '8: 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"'
\ ])