All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 call ale#test#SetDirectory('/testplugin/test/handler')
4 runtime ale_linters/perl/perl.vim
7 call ale#test#RestoreDirectory()
8 call ale#linter#Reset()
10 Execute(The Perl linter should handle empty output):
11 call ale#test#SetFilename('bar.pl')
13 AssertEqual [], ale_linters#perl#perl#Handle(bufnr(''), [])
15 Execute(The Perl linter should ignore errors from other files):
16 call ale#test#SetFilename('bar.pl')
20 \ {'lnum': '2', 'type': 'E', 'text': 'Compilation failed in require'},
22 \ ale_linters#perl#perl#Handle(bufnr(''), [
23 \ 'syntax error at ' . ale#path#Simplify(g:dir . '/foo.pm') . ' line 4, near "aklsdfjmy "',
24 \ 'Compilation failed in require at ' . ale#path#Simplify(g:dir . '/bar.pl') . ' line 2.',
25 \ 'BEGIN failed--compilation aborted at ' . ale#path#Simplify(g:dir . '/bar.pl') . ' line 2.',
28 Execute(The Perl linter should complain about failing to locate modules):
34 \ 'text': 'Can''t locate JustOneDb.pm in @INC (you may need to install the JustOneDb module) (@INC contains: /home/local/sean/work/PostgreSQL/6616/../../../../lib /home/local/sean/work/PostgreSQL/6616/lib lib /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .)',
37 \ ale_linters#perl#perl#Handle(bufnr(''), [
38 \ 'Can''t locate JustOneDb.pm in @INC (you may need to install the JustOneDb module) (@INC contains: /home/local/sean/work/PostgreSQL/6616/../../../../lib /home/local/sean/work/PostgreSQL/6616/lib lib /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at - line 23.',
39 \ 'BEGIN failed--compilation aborted at - line 23.',
43 Execute(The Perl linter should complain about failing to locate modules):
46 \ {'lnum': '8', 'type': 'E', 'text': 'BEGIN failed--compilation aborted'},
47 \ {'lnum': '10', 'type': 'E', 'text': 'BEGIN failed--compilation aborted'}
49 \ ale_linters#perl#perl#Handle(bufnr(''), [
50 \ 'Unable to build `ro` accessor for slot `path` in `App::CPANFileUpdate` because the slot cannot be found. at /extlib/Method/Traits.pm line 189.',
51 \ 'BEGIN failed--compilation aborted at - line 8.',
52 \ 'Unable to build `ro` accessor for slot `path` in `App::CPANFileUpdate` because the slot cannot be found. at /extlib/Method/Traits.pm line 189.',
53 \ 'BEGIN failed--compilation aborted at - line 10.',
56 Execute(The Perl linter should not report warnings as errors):
59 \ {'lnum': '5', 'type': 'W', 'text': '"my" variable $foo masks earlier declaration in same scope'},
61 \ ale_linters#perl#perl#Handle(bufnr(''), [
62 \ '"my" variable $foo masks earlier declaration in same scope at - line 5.',
66 Execute(The Perl linter does not default to reporting generic error):
69 \ {'lnum': '8', 'type': 'E', 'text': 'Missing right curly or square bracket'},
71 \ ale_linters#perl#perl#Handle(bufnr(''), [
72 \ 'Missing right curly or square bracket at - line 8, at end of line',
73 \ 'syntax error at - line 8, at EOF',
74 \ 'Execution of t.pl aborted due to compilation errors.',
77 " The first "error" is actually a warning, but the current implementation
78 " doesn't have a good way of teasing out the warnings from amongst the
79 " errors. If we're able to do this in future, then we'll want to switch
80 " the first "E" to a "W".
82 Execute(The Perl linter reports errors even when mixed with warnings):
85 \ {'lnum': '5', 'type': 'E', 'text': '"my" variable $foo masks earlier declaration in same scope'},
86 \ {'lnum': '8', 'type': 'E', 'text': 'Missing right curly or square bracket'},
88 \ ale_linters#perl#perl#Handle(bufnr(''), [
89 \ '"my" variable $foo masks earlier declaration in same scope at - line 5.',
90 \ 'Missing right curly or square bracket at - line 8, at end of line',
91 \ 'syntax error at - line 8, at EOF',
92 \ 'Execution of t.pl aborted due to compilation errors.',
95 Execute(The Perl linter reports errors even when an additional file location is included):
98 \ {'lnum': '5', 'type': 'E', 'text': '"my" variable $foo masks earlier declaration in same scope'},
99 \ {'lnum': '6', 'type': 'E', 'text': '"my" variable $foo masks earlier declaration in same scope'},
100 \ {'lnum': '11', 'type': 'E', 'text': 'Global symbol "$asdf" requires explicit package name (did you forget to declare "my $asdf"?)'},
101 \ {'lnum': '12', 'type': 'E', 'text': 'Global symbol "$asdf" requires explicit package name (did you forget to declare "my $asdf"?)'},
103 \ ale_linters#perl#perl#Handle(bufnr(''), [
104 \ '"my" variable $foo masks earlier declaration in same scope at - line 5.',
105 \ '"my" variable $foo masks earlier declaration in same scope at - line 6, at <DATA> line 1.',
106 \ 'Global symbol "$asdf" requires explicit package name (did you forget to declare "my $asdf"?) at - line 11.',
107 \ 'Global symbol "$asdf" requires explicit package name (did you forget to declare "my $asdf"?) at - line 12, <DATA> line 1.',
108 \ 'Execution of t.pl aborted due to compilation errors.',