Compare commits

...

4 Commits

Author SHA1 Message Date
w0rp 97b410bbba Merge pull request #342 from Exteris/bugfix/gfortran-6.3.1
Update line marker pattern for new gfortran
2017-02-21 20:38:57 +00:00
Chris Paul 78b05d30a5 escape dot in maker regex (#357)
* escape dot in maker regex

* Create test_typecheck_handler

* Rename test_typecheck_handler to test_typecheck_handler.vader
2017-02-21 20:33:16 +00:00
w0rp 6f6c156995 Fix Pug linting 2017-02-11 20:47:11 +00:00
w0rp 62a45f8ae4 Don't export the custom-checks script in archives 2017-02-09 19:34:31 +00:00
7 changed files with 163 additions and 3 deletions

1
.gitattributes vendored
View File

@ -5,3 +5,4 @@
/README.md export-ignore
/img export-ignore
/test export-ignore
/custom-checks export-ignore

View File

@ -12,7 +12,7 @@ function! ale_linters#fortran#gcc#Handle(buffer, lines) abort
"
" :21.34:
" Error: Expected comma in I/O list at (1)
let l:line_marker_pattern = '^:\(\d\+\)\.\(\d\+\):$'
let l:line_marker_pattern = ':\(\d\+\)[.:]\=\(\d\+\)\=:\=$'
let l:message_pattern = '^\(Error\|Warning\): \(.\+\)$'
let l:looking_for_message = 0
let l:last_loclist_obj = {}

View File

@ -7,7 +7,7 @@ function! ale_linters#typescript#typecheck#Handle(buffer, lines) abort
" hello.ts[7, 41]: Property 'a' does not exist on type 'A'
" hello.ts[16, 7]: Type 'A' is not assignable to type 'B'
"
let l:pattern = '.\+.ts\[\(\d\+\), \(\d\+\)\]: \(.\+\)'
let l:pattern = '.\+\.ts\[\(\d\+\), \(\d\+\)\]: \(.\+\)'
let l:output = []
for l:line in a:lines

View File

@ -12,7 +12,7 @@ function! s:HandleUnixFormat(buffer, lines, type) abort
" file.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args
" file.go:53:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
" file.go:5:2: expected declaration, found 'STRING' "log"
let l:pattern = '^' . s:path_pattern . ':\(\d\+\):\?\(\d\+\)\?: \(.\+\)$'
let l:pattern = '^' . s:path_pattern . ':\(\d\+\):\?\(\d\+\)\?:\? \(.\+\)$'
let l:output = []
for l:line in a:lines

View File

@ -86,6 +86,7 @@ Execute (Run HandleUnixFormatAsError):
let g:loclist = ale#handlers#HandleUnixFormatAsError(42, [
\ 'file.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args',
\ 'file.go:53:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)',
\ 'test.pug:1:1 ".b" is not a valid class name. Class names must begin with "-", "_" or a letter and can only contain "_", "-", a-z and 0-9.',
\])
Then (The loclist should be correct):
@ -108,6 +109,15 @@ Then (The loclist should be correct):
\ 'type': 'E',
\ 'text': 'if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)',
\ },
\ {
\ 'bufnr': 42,
\ 'vcol': 0,
\ 'nr': -1,
\ 'lnum': 1,
\ 'col': 1,
\ 'type': 'E',
\ 'text': '".b" is not a valid class name. Class names must begin with "-", "_" or a letter and can only contain "_", "-", a-z and 0-9.',
\ },
\], g:loclist
Execute (Run HandleUnixFormatAsWarning):

View File

@ -0,0 +1,118 @@
Execute(The fortran handler should parse lines from GCC 4.1.2 correctly):
runtime ale_linters/fortran/gcc.vim
AssertEqual
\ [
\ {
\ 'bufnr': 357,
\ 'lnum': 4,
\ 'vcol': 0,
\ 'col': 0,
\ 'text': "Symbol b at (1) has no IMPLICIT type",
\ 'type': 'E',
\ 'nr': -1,
\ },
\ {
\ 'bufnr': 357,
\ 'lnum': 3,
\ 'vcol': 0,
\ 'col': 0,
\ 'text': "Symbol a at (1) has no IMPLICIT type",
\ 'type': 'E',
\ 'nr': -1,
\ },
\ ],
\ ale_linters#fortran#gcc#Handle(357, [
\ " In file :4",
\ "",
\ "write(*,*) b",
\ " 1",
\ "Error: Symbol b at (1) has no IMPLICIT type",
\ " In file :3",
\ "",
\ "write(*,*) a",
\ " 1",
\ "Error: Symbol a at (1) has no IMPLICIT type",
\ ])
After:
call ale#linter#Reset()
Execute(The fortran handler should parse lines from GCC 4.9.3 correctly):
runtime ale_linters/fortran/gcc.vim
AssertEqual
\ [
\ {
\ 'bufnr': 357,
\ 'lnum': 3,
\ 'vcol': 0,
\ 'col': 12,
\ 'text': "Symbol a at (1) has no IMPLICIT type",
\ 'type': 'E',
\ 'nr': -1,
\ },
\ {
\ 'bufnr': 357,
\ 'lnum': 4,
\ 'vcol': 0,
\ 'col': 12,
\ 'text': "Symbol b at (1) has no IMPLICIT type",
\ 'type': 'E',
\ 'nr': -1,
\ },
\ ],
\ ale_linters#fortran#gcc#Handle(357, [
\ ":3.12:",
\ "",
\ "write(*,*) a",
\ " 1",
\ "Error: Symbol a at (1) has no IMPLICIT type",
\ ":4.12:",
\ "",
\ "write(*,*) b",
\ " 1",
\ "Error: Symbol b at (1) has no IMPLICIT type",
\ ])
After:
call ale#linter#Reset()
Execute(The fortran handler should parse lines from GCC 6.3.1 correctly):
runtime ale_linters/fortran/gcc.vim
AssertEqual
\ [
\ {
\ 'bufnr': 337,
\ 'lnum': 3,
\ 'vcol': 0,
\ 'col': 12,
\ 'text': "Symbol a at (1) has no IMPLICIT type",
\ 'type': 'E',
\ 'nr': -1,
\ },
\ {
\ 'bufnr': 337,
\ 'lnum': 4,
\ 'vcol': 0,
\ 'col': 12,
\ 'text': "Symbol b at (1) has no IMPLICIT type",
\ 'type': 'E',
\ 'nr': -1,
\ },
\ ],
\ ale_linters#fortran#gcc#Handle(337, [
\ "<stdin>:3:12:",
\ "",
\ "Error: Symbol a at (1) has no IMPLICIT type",
\ "<stdin>:4:12:",
\ "",
\ "Error: Symbol b at (1) has no IMPLICIT type",
\ ])
After:
call ale#linter#Reset()

View File

@ -0,0 +1,31 @@
Execute(The typecheck handler should parse lines correctly):
runtime ale_linters/typescript/typecheck.vim
AssertEqual
\ [
\ {
\ 'bufnr': 347,
\ 'lnum': 16,
\ 'vcol': 0,
\ 'col': 7,
\ 'text': "Type 'A' is not assignable to type 'B'",
\ 'type': 'E',
\ 'nr': -1,
\ },
\ {
\ 'bufnr': 347,
\ 'lnum': 7,
\ 'vcol': 0,
\ 'col': 41,
\ 'text': "Property 'a' does not exist on type 'A'",
\ 'type': 'E',
\ 'nr': -1,
\ },
\ ],
\ ale_linters#typescript#typecheck#Handle(347, [
\ "somets.ts[16, 7]: Type 'A' is not assignable to type 'B'",
\ "somets.ts[7, 41]: Property 'a' does not exist on type 'A'",
\ ])
After:
call ale#linter#Reset()