From 62a45f8ae4ac3ee70a04ba07b6cd018ef1b88c64 Mon Sep 17 00:00:00 2001 From: w0rp Date: Thu, 9 Feb 2017 19:34:31 +0000 Subject: [PATCH 1/4] Don't export the custom-checks script in archives --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 394e02d..d9c0b18 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,3 +5,4 @@ /README.md export-ignore /img export-ignore /test export-ignore +/custom-checks export-ignore From 6f6c1569952176f39ebc9c520f91652320fdcec4 Mon Sep 17 00:00:00 2001 From: w0rp Date: Sat, 11 Feb 2017 18:49:12 +0000 Subject: [PATCH 2/4] Fix Pug linting --- autoload/ale/handlers.vim | 2 +- test/test_common_handlers.vader | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/autoload/ale/handlers.vim b/autoload/ale/handlers.vim index 4f1611f..544c91d 100644 --- a/autoload/ale/handlers.vim +++ b/autoload/ale/handlers.vim @@ -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 diff --git a/test/test_common_handlers.vader b/test/test_common_handlers.vader index ed3b164..0968a91 100644 --- a/test/test_common_handlers.vader +++ b/test/test_common_handlers.vader @@ -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): From 78b05d30a56ad3e74e6831b04b0cbe1e3a651143 Mon Sep 17 00:00:00 2001 From: Chris Paul Date: Tue, 21 Feb 2017 12:32:38 -0800 Subject: [PATCH 3/4] escape dot in maker regex (#357) * escape dot in maker regex * Create test_typecheck_handler * Rename test_typecheck_handler to test_typecheck_handler.vader --- ale_linters/typescript/typecheck.vim | 2 +- test/test_typecheck_handler.vader | 31 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 test/test_typecheck_handler.vader diff --git a/ale_linters/typescript/typecheck.vim b/ale_linters/typescript/typecheck.vim index 080a238..0de6639 100644 --- a/ale_linters/typescript/typecheck.vim +++ b/ale_linters/typescript/typecheck.vim @@ -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 diff --git a/test/test_typecheck_handler.vader b/test/test_typecheck_handler.vader new file mode 100644 index 0000000..2f8a219 --- /dev/null +++ b/test/test_typecheck_handler.vader @@ -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() From 97b410bbba88b119995c935b519164685537b579 Mon Sep 17 00:00:00 2001 From: w0rp Date: Tue, 14 Feb 2017 19:06:25 +0000 Subject: [PATCH 4/4] Merge pull request #342 from Exteris/bugfix/gfortran-6.3.1 Update line marker pattern for new gfortran --- ale_linters/fortran/gcc.vim | 2 +- test/test_fortran_handler.vader | 118 ++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 test/test_fortran_handler.vader diff --git a/ale_linters/fortran/gcc.vim b/ale_linters/fortran/gcc.vim index 73ec788..8d15cc0 100644 --- a/ale_linters/fortran/gcc.vim +++ b/ale_linters/fortran/gcc.vim @@ -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 = {} diff --git a/test/test_fortran_handler.vader b/test/test_fortran_handler.vader new file mode 100644 index 0000000..7648ff6 --- /dev/null +++ b/test/test_fortran_handler.vader @@ -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, [ + \ ":3:12:", + \ "", + \ "Error: Symbol ‘a’ at (1) has no IMPLICIT type", + \ ":4:12:", + \ "", + \ "Error: Symbol ‘b’ at (1) has no IMPLICIT type", + \ ]) + +After: + call ale#linter#Reset()