andviro / flake8-vim Goto Github PK
View Code? Open in Web Editor NEWPyflakes, Pep8 and mccabe code complexity checker for Vim, bundled with latest libraries for easy installation
Pyflakes, Pep8 and mccabe code complexity checker for Vim, bundled with latest libraries for easy installation
Right now whenever I run PyFlake the file is immediately written to the filesystem, the result is that when I'm simply checking the file it automatically writes to the filesystem which (in the case of syntax errors) results in my development server crashing because it auto-reloads on file changes.
If the command has to write for it to work, can it write to a temporary file instead perhaps?
The better solution would be to pipe the data straight towards the flake8 stdin imho, but not sure if that's too easy to integrate into the current script.
The flake8 command at least supports this using the following syntax:
cat some_python_file.py | flake8 -
If I read 005ecfa correctly, I should be able to select an error and press shift-q to fix it. If I for example remove the : after an if statement and run :PyFlake to get the error, then select the line with the error and press shift-q I get "syntax error". Any ideas? Did I misunderstand?
I would like to help integrate this project:
https://github.com/openstack-dev/hacking
Into flake8-vim. I would love to drive this forward if you could offer advice/assistance.
-=cj
Hi,
autopep8 is replacing pep8 continued_indentation with its own function
del pep8._checks['logical_line'][pep8.continued_indentation]
pep8.register_check(continued_indentation)
The problem is that the function from autopep8 does not explain the error, instead it only prints the error code and the indent level e.g. E125 {0}
.
If one is currently using python-mode with vim (7.4) and they have the following in their vimrc
let g:pymode_rope = 1
let g:pymode_lint = 1
They get the following error with flake8-vim,
Error detected while processing function pymode#buffer_post_write:
line 2:
E121: Undefined variable: b:pymode_modified
E15: Invalid expression: b:pymode_modified && g:pymode_rope_regenerate_on_write
line 8:
E121: Undefined variable: b:pymode_modified
E15: Invalid expression: g:pymode_lint_unmodified || (g:pymode_lint_on_write && b:pymode_modified)
One way to resolve the issue is to do,
let g:pymode_rope = 0
let g:pymode_lint = 0
If I have a Tagbar split opened, flake8-vim opens the quickfix only below the half-screen window. I expected it to use the full width of vim.
After updating to the latest commit, I get the behaviour seen here:
http://www.gfycat.com/ThreadbareDaringGossamerwingedbutterfly
Note that I am just typing signals.
and not hitting return anywhere. I am trying to type signals.post
.
I reverted back to 7cecb3a and I'm no longer having the problem.
git clone --recursive https://github.com/andviro/flake8-vim.git
(...)
Cloning into 'ftplugin/python/pyflakes'...
Username for 'https://github.com':
-> failure
I've just installed flake8-vim with Vundle. After :PyFlake
I am getting following errors:
Error detected while processing function flake8#run..flake8#check:
line 1:
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'flake8_check' is not defined
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)
Press ENTER or type command to continue
My .vimrc is:
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'andviro/flake8-vim'
call vundle#end() " required
filetype plugin indent on " required
I have flake8 installed:
$ flake8 --version
2.5.1 (pep8: 1.7.0, pyflakes: 1.5.0, mccabe: 0.3.1) CPython 2.7.12 on Linux
and python2:
$ python2 --version
Python 2.7.12 :: Continuum Analytics, Inc.
and vim of course:
$ vim --version
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Apr 5 2012 10:17:30)
Included patches: 1-411
Modified by <[email protected]>
Compiled by <[email protected]>
Huge version without GUI. Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
+float +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand
+jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap
+menu +mksession +modify_fname +mouse -mouseshape +mouse_dec +mouse_gpm
-mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte
+multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra +perl +postscript
+printer +profile +python +quickfix +reltime +rightleft -ruby +scrollbind
+signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax
+tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse
+textobjects +title -toolbar +user_commands +vertsplit +virtualedit +visual
+visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup
-X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=1 -D_REENTRANT -D_GNU_SOURCE -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/CORE -I/usr/include/python2.6 -pthread
Linking: gcc -Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE -L/usr/local/lib -o vim -lselinux -lncurses -lacl -lgpm -Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE -fstack-protector -L/usr/lib64/perl5/CORE -lperl -lresolv -lutil -lc -L/usr/lib64/python2.6/config -lpython2.6 -lutil -lm -Xlinker -export-dynamic
Am I doing something wrong or is it some kind of a bug?
I just searched the code and don't see it being used anywhere. I would use it if it worked.
As you can see, after deleting the two lines that are marked as errors, the import os
line is now marked as an error which is incorrect. Only after saving the file again it is marked as correct again. But in some cases that doesn't happen either.
Any idea what could be wrong with my config? Or is it a bug?
Can you auto-update flake8-vim when dependencies packages are updated ?
I see we currently use Frosted 1.4.0, when I wish to use v1.4.1 (for the noqa feature).
Thanks
Cordially
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)
When I install via vundle or copy ftplugin in vim folder the plugin is not loaded. I have filetype plugin indent on. I see the vim file is quite deep in the directory. Could it be the issue ? How can I fix that ? I have vim 7.4.52
Hello -- first of all, thanks for the amazing plugin, I love it so far!
I just had a quick note/question. If I select the entire file in visual mode and run PyFlakeAuto, it doesn't seem to auto-correct everything. In my case, it simply fix whitespace errors like adding extra blank lines or removing trailing whitespace. Is there a config that changes this?
I was also wondering if there is a way to run the same command whenever a python buffer is saved.
Thanks again for making such a great plugin!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.