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.
5 Save g:ale_maximum_file_size
6 Save b:ale_maximum_file_size
8 function! SetUpCursorData()
9 let g:ale_buffer_info = {
15 \ 'linter_name': 'testlinter',
26 function! TestCallback(buffer, output)
30 call ale#linter#Define('foobar', {
31 \ 'name': 'testlinter',
32 \ 'callback': 'TestCallback',
33 \ 'executable': 'echo',
37 function GetLastMessage()
42 " Filter out messages that could come from saving this test file.
43 let l:lines = filter(split(l:output, "\n"), 'v:val !~ ''written\|No line''')
45 return empty(l:lines) ? '' : l:lines[-1]
52 call ale#linter#Reset()
53 delfunction TestCallback
54 delfunction GetLastMessage
55 delfunction SetUpCursorData
57 Given foobar (Some imaginary filetype):
62 Execute(Linting shouldn't happen when ALE is disabled globally):
64 let g:ale_buffer_info = {}
68 AssertEqual {}, g:ale_buffer_info
69 call SetUpCursorData()
70 call ale#cursor#EchoCursorWarning()
71 AssertEqual '', GetLastMessage()
73 Execute(Linting shouldn't happen when ALE is disabled locally):
75 let g:ale_buffer_info = {}
79 AssertEqual {}, g:ale_buffer_info
80 call SetUpCursorData()
81 call ale#cursor#EchoCursorWarning()
82 AssertEqual '', GetLastMessage()
84 Execute(Linting shouldn't happen when the file is too large with global options):
85 let g:ale_maximum_file_size = 12
86 let g:ale_buffer_info = {}
90 AssertEqual {}, g:ale_buffer_info
91 " We shouldn't show cursor warnings.
92 call SetUpCursorData()
93 call ale#cursor#EchoCursorWarning()
94 AssertEqual '', GetLastMessage()
96 Execute(Linting shouldn't happen when the file is too large with local options):
97 let b:ale_maximum_file_size = 12
98 let g:ale_buffer_info = {}
102 AssertEqual {}, g:ale_buffer_info
103 call SetUpCursorData()
104 call ale#cursor#EchoCursorWarning()
105 AssertEqual '', GetLastMessage()