andviro / flake8-vim

Pyflakes, Pep8 and mccabe code complexity checker for Vim, bundled with latest libraries for easy installation
63 stars 18 forks source link

Traceback when function var without default follows var with default set #2

Closed maedox closed 11 years ago

maedox commented 11 years ago

PyFlake doesn't seem to handle the syntax(?) error of defining a function where a variable with a default value is followed by a variable without a default.

Minimal code to reproduce

def failure(var1="test", var2):
    pass

Quickfix output Error detected while processing function flake8#on_write..flake8#check: line 1: E121: Undefined variable: null E15: Invalid expression: [{"lnum": null, "text": "non-default argument follows default argument", "type": "E", "col": 0, "filename": "/home/paal/tmp.py"}] Traceback (most recent call last): File "", line 1, in File "", line 15, in flake8_check File "", line 18, in parse_result vim.error line 3: E121: Undefined variable: g:qf_list E15: Invalid expression: g:qf_list line 6: E121: Undefined variable: g:qf_list E116: Invalid arguments for function setqflist line 16: E121: Undefined variable: g:qf_list E116: Invalid arguments for function len(g:qf_list) E15: Invalid expression: len(g:qf_list)

andviro commented 11 years ago

Hmm, I wonder why compile() throws broken SyntaxError instance in this case. I'll look into it, thanks.

andviro commented 11 years ago

I guess that does it. Thanks for the issue, I was too lazy to implement syntax errors properly.