vim-syntastic / syntastic

Syntax checking hacks for vim
Do What The F*ck You Want To Public License
11.3k stars 1.14k forks source link

Syntastic not working #2310

Closed hjtran closed 4 years ago

hjtran commented 4 years ago

Hi all,

This is probably gonna be a silly issue but I'm stuck and can't figure it out.

Using syntastic with a new repo. I've installed pyflakes in it and I've confirmed I can run it using /Users/joey/repo/domsim/.venv/bin/pyflakes src/domsim/domgame.py. After running :SyntasticInfo python I get:

Syntastic version: 3.8.0-56 (Vim 802, Darwin)
Info for filetype: python
Global mode: active
Filetype python is active
Available checkers: flake8 pep8 pycodestyle pyflakes python
Currently enabled checker: pyflakes

So things look to be in good shape. But when I run :SyntasticCheck pyflakes or save the file, I get no reported errors. I've also checked the path with echo syntastic#util#system('echo "$PATH"') and I get /Users/joey/repo/domsim/.venv/bin: as the first hit. I have the recommended vimrc settings:

let $PATH = $PATH.':/Users/joey/.vim/bundle/syntastic/syntax_checkers/'
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
let g:syntastic_check_on_wq = 0
let g:syntastic_python_checkers = ['pyflakes']

Any help would be greatly appreciated. I recognize this is probably just a silly newbie issue

lcd047 commented 4 years ago

Is your pyflakes supposed to run in a venv or outside it? If the former then you should activate the environment, run Vim from the environment, and syntastic should pick it up without any $PATH massaging. If the latter then you should just do something like this:

let g:syntastic_python_pyplakes_exec = '/Users/joey/repo/domsim/.venv/bin/pyflakes'

and again leave out $PATH.

But if you want to debug the lack of errors, assuming you have no plugins getting in the way of syntastic: please upgrade syntastic to the latest version (yours is 3+ years old), open your test file, set g:syntastic_debug to 3, run the checker, then run :mes and post the output.