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 Save g:ale_warn_about_trailing_blank_lines
3 Save g:ale_warn_about_trailing_whitespace
5 let g:ale_warn_about_trailing_blank_lines = 1
6 let g:ale_warn_about_trailing_whitespace = 1
8 runtime ale_linters/python/flake8.vim
13 unlet! b:ale_warn_about_trailing_blank_lines
14 unlet! b:ale_warn_about_trailing_whitespace
16 call ale#linter#Reset()
18 Execute(The flake8 handler should handle basic warnings and syntax errors):
26 \ 'text': 'indentation is not a multiple of four',
28 \ 'sub_type': 'style',
35 \ 'text': 'some warning',
37 \ 'sub_type': 'style',
44 \ 'text': 'SyntaxError: invalid syntax',
48 \ ale_linters#python#flake8#Handle(1, [
49 \ 'stdin:6:6: E111 indentation is not a multiple of four',
50 \ 'stdin:7:6: W123 some warning',
51 \ 'stdin:8:3: E999 SyntaxError: invalid syntax',
54 Execute(The flake8 handler should set end column indexes for certain errors):
63 \ 'text': 'undefined name ''foo''',
72 \ 'text': 'hello may be undefined, or defined from star imports: x',
81 \ 'text': '''continue'' not properly in loop',
90 \ 'text': '''break'' outside loop',
99 \ 'text': 'local variable ''test'' is assigned to but never used',
103 \ ale_linters#python#flake8#Handle(1, [
104 \ 'foo.py:25:1: F821 undefined name ''foo''',
105 \ 'foo.py:28:5: F405 hello may be undefined, or defined from star imports: x',
106 \ 'foo.py:104:5: F999 ''continue'' not properly in loop',
107 \ 'foo.py:106:5: F999 ''break'' outside loop',
108 \ 'foo.py:109:5: F841 local variable ''test'' is assigned to but never used',
111 Execute(The flake8 handler should handle stack traces):
116 \ 'text': 'ImportError: No module named parser (See :ALEDetail)',
118 \ 'Traceback (most recent call last):',
119 \ ' File "/usr/local/bin/flake8", line 7, in <module>',
120 \ ' from flake8.main.cli import main',
121 \ ' File "/usr/local/lib/python2.7/dist-packages/flake8/main/cli.py", line 2, in <module>',
122 \ ' from flake8.main import application',
123 \ ' File "/usr/local/lib/python2.7/dist-packages/flake8/main/application.py", line 17, in <module>',
124 \ ' from flake8.plugins import manager as plugin_manager',
125 \ ' File "/usr/local/lib/python2.7/dist-packages/flake8/plugins/manager.py", line 5, in <module>',
126 \ ' import pkg_resources',
127 \ ' File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 35, in <module>',
128 \ ' import email.parser',
129 \ 'ImportError: No module named parser',
133 \ ale_linters#python#flake8#Handle(42, [
134 \ 'Traceback (most recent call last):',
135 \ ' File "/usr/local/bin/flake8", line 7, in <module>',
136 \ ' from flake8.main.cli import main',
137 \ ' File "/usr/local/lib/python2.7/dist-packages/flake8/main/cli.py", line 2, in <module>',
138 \ ' from flake8.main import application',
139 \ ' File "/usr/local/lib/python2.7/dist-packages/flake8/main/application.py", line 17, in <module>',
140 \ ' from flake8.plugins import manager as plugin_manager',
141 \ ' File "/usr/local/lib/python2.7/dist-packages/flake8/plugins/manager.py", line 5, in <module>',
142 \ ' import pkg_resources',
143 \ ' File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 35, in <module>',
144 \ ' import email.parser',
145 \ 'ImportError: No module named parser',
148 Execute(The flake8 handler should handle names with spaces):
156 \ 'text': 'indentation is not a multiple of four',
158 \ 'sub_type': 'style',
161 \ ale_linters#python#flake8#Handle(42, [
162 \ 'C:\something\with spaces.py:6:6: E111 indentation is not a multiple of four',
165 Execute(Warnings about trailing whitespace should be reported by default):
174 \ 'sub_type': 'style',
175 \ 'text': 'who cares',
183 \ 'sub_type': 'style',
184 \ 'text': 'who cares',
187 \ ale_linters#python#flake8#Handle(bufnr(''), [
188 \ 'foo.py:6:1: W291 who cares',
189 \ 'foo.py:6:1: W293 who cares',
192 Execute(Disabling trailing whitespace warnings should work):
193 let b:ale_warn_about_trailing_whitespace = 0
198 \ ale_linters#python#flake8#Handle(bufnr(''), [
199 \ 'foo.py:6:1: W291 who cares',
200 \ 'foo.py:6:1: W293 who cares',
203 Execute(Warnings about trailing blank lines should be reported by default):
212 \ 'sub_type': 'style',
213 \ 'text': 'blank line at end of file',
216 \ ale_linters#python#flake8#Handle(bufnr(''), [
217 \ 'foo.py:6:1: W391 blank line at end of file',
220 Execute(Disabling trailing blank line warnings should work):
221 let b:ale_warn_about_trailing_blank_lines = 0
226 \ ale_linters#python#flake8#Handle(bufnr(''), [
227 \ 'foo.py:6:1: W391 blank line at end of file',
230 Execute(F401 should be a warning):
239 \ 'text': 'module imported but unused',
242 \ ale_linters#python#flake8#Handle(bufnr(''), [
243 \ 'foo.py:6:1: F401 module imported but unused',
246 Execute(E112 should be a syntax error):
255 \ 'text': 'expected an indented block',
258 \ ale_linters#python#flake8#Handle(bufnr(''), [
259 \ 'foo.py:6:1: E112 expected an indented block',
262 Execute(Compatibility with hacking which uses older style flake8):
271 \ 'text': 'imports not in alphabetical order (smtplib, io)',
274 \ ale_linters#python#flake8#Handle(bufnr(''), [
275 \ 'foo.py:6:1: H306: imports not in alphabetical order (smtplib, io)',