Syntastic not checking python code - vim

I have both syntastic and python-mode installed.. However, I want to syntax check using syntastic.. To do this, I have disabled pymode check with, let g:pymode_lint = 0
Also, when python file if opened, syntastic says that checker is present, but does not detect errors..
Currently active checker = python

Related

How to setup Syntastic as python3 checker instead of python2

In MacVim, I save following code as test.py
print "Hello world! python2"
, which is apparently wrong with python3, but
after I run :w to save the file, there is no error message for it,
Following is a part of ~/.vimrc, which is all about Syntastic:
" Syntastic
"" Recommended settings
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
"" Display checker-name for that error-message
let g:syntastic_aggregate_errors = 1
"" I use the brew to install flake8
let g:syntastic_python_checkers=['flake8', 'python3']
How to make Syntastic detect this type of error as I run test.py in Terminal:
NingGW:Desktop ninggw$ python3 test.py
File "test.py", line 1
print "Hello world! python2"
^
SyntaxError: Missing parentheses in call to 'print'
Following is what :SyntasticInfo said:
Syntastic version: 3.8.0-10 (Vim 800, Darwin, GUI)
Info for filetype: python
Global mode: active
Filetype python is active
The current file will be checked automatically
Available checkers: flake8 python
Currently enabled checker: flake8
Press ENTER or type command to continue
flake8 is a Python package. It uses Python's built-in facilities to parse code, so it accepts syntax for the Python version that it belongs to.
How to install it for your python3 installation depends on how that installation itself was installed - unless you're fine with using pip.
From the FAQ:
4.11. Q. How can I check scripts written for different versions of Python?
A. Install a Python version manager such as virtualenv or pyenv, activate the environment for the relevant version of Python, and install in it the checkers you want to use. Set g:syntastic_python_checkers accordingly in your vimrc, and run Vim from the virtual environment.
If you're starting Vim from a desktop manager rather than from a terminal you might need to write wrapper scripts around your checkers, to activate the virtual environment before running the actual checks. Then you'll need to point the relevant g:syntastic_python_<checker>_exec variables to the wrapper scripts.

django html syntastic configuration in .vimrc

I'm new in vim, and i've just installed syntastic, my question is how to activate syntastic to check htmldjango type, i have installed pylint and pylint-django, this is my SyntasticInfo
Syntastic version: 3.8.0-3 (Vim 800, Linux, GUI)
Info for filetype: htmldjango
Global mode: active
Filetype htmldjango is active
The current file will be checked automatically
Available checkers: -
Currently enabled checkers: -
Thankyou
There are two reasons this isn't working. First, to get pylint-django to "attempt" to check an htmldjango file, you'd have to insert this into your .vimrc file:
let g:syntastic_python_pylint_args = "--load-plugins pylint_django"
let g:syntastic_htmldjango_checkers = ['python/pylint']
Note that you have to specify 'python/pylint' as the checker as this is a foreign checker to the htmldjango filetype.
That will fix your SyntasticInfo issue:
Currently enabled checker: python/pylint
HOWEVER, currently python-pylint doesn't support djangohtml templates at all so even once you've done this you'll be disappointed and get all kinds of syntax errors...because the checker only supports django model and view filetypes...(-‸ლ)

Syntastic going passive mode

It's been quite some time that I'm facing this annoying problem with syntastic.
When running gvim and performing a SyntasticInfo c, without opening anything, it returns me :
Syntastic version: 3.5.0-72
Info for filetype: c
Mode: active
Filetype c is active
Available checkers: clang_check gcc make
Currently enabled checker: clang_check
But as soon as I open a c file and do a SyntasticInfo I get:
Syntastic version: 3.5.0-72
Info for filetype: c
Mode: active
Passive filetype: c
Filetype c is passive
Available checkers: clang_check gcc make
Currently enabled checker: clang_check
As a result nothing is checked.
Here is what is in my vimrc :
let g:syntastic_check_on_open = 1
let g:syntastic_c_checkers = ['clang_check']
let g:syntastic_c_clang_post_args = ""
let g:syntastic_mode_map={"mode":"active", "active_filetypes": [], "passive_filetypes": []}
[Edit]
Having tried to put 'c' for active_filetypes, it doesn't change anything. Though, what is really weird, is that the active checking is not triggered if I don't do a :so ~/.vimrc and every time I open gvim. It's as if this option wasn't taken into account by gvim.
[/Edit]
Thank you in advance for any help
You probably have Eclim installed. Eclim silently disables syntastic for the filetypes it can handle. Recent versions of syntastic warn you when this situation is detected.

syntastic checker does not work in Gvim in Windows 7

I installed syntastic according to following link in windows.
https://github.com/scrooloose/syntastic.
I ran :SyntasticInfo. Here is the output
I guess everything is fine & syntastic checker is set for c file with gcc. I purposefully removed semicolons & brackets.But none of the errors got highlighted in my source code file even after saving.
Any suggestions on how to make syntastic checker work ??

Disable pep8 check in syntastic for python files

I work with enough code that does not follow pep8 (that I cannot fix) and would like syntastic to not use the pep8 syntax checker. Any way to disable it?
If your are using flake8 as a python syntax checker you could do it like this (put it into your vimrc or ftplugin/python.vim file):
let g:syntastic_python_checkers=['flake8']
let g:syntastic_python_flake8_args='--ignore=E501,E225'
You need to silence each error class explicitly (and cannot disable pep8 checking as a whole). See the flake8 documentation and pycodestyle documentation (used to be pep8) for all error and warning codes.
Adding to Christians answer. You can also add specific checker args:
let g:syntastic_python_flake8_args = "--ignore=E501 --max-complexity 10"

Resources