If file does not exist flake8 crashes
When a new file is edited (and not yet saved) you cannot run
flake8 on it because it crashes. This diverts from dealing with an invalid/non-existent path with
pyflakes for example.
Shown below is what would happen with a non-existent
foo.py file and what happens with
pyflakes and what does with
# pyflakes foo.py foo.py: No such file or directory # flake8 foo.py Traceback (most recent call last): File "/usr/local/bin/flake8", line 8, in <module> load_entry_point('flake8==1.5', 'console_scripts', 'flake8')() File "/Library/Python/2.7/site-packages/flake8/run.py", line 68, in main for path in _get_python_files(pep8style.paths): File "/Library/Python/2.7/site-packages/flake8/run.py", line 51, in _get_python_files if not skip_file(path): File "/Library/Python/2.7/site-packages/flake8/util.py", line 30, in skip_file f = open(path) IOError: [Errno 2] No such file or directory: 'foo.py'
I wrote a Vim plugin that checks your code on the fly and this particular issue is very painful to deal with as I need to see if there was a traceback thrown to