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"
Related
I'd like to be able to either increase the max linelength or tell the code formatting checkers to ignore E501. Previous solutions are very old, but more importantly, do not work for me. I just installed eclipse:
Version: 2022-06 (4.24.0)
Build id: 20220609-1112
Code formatter settings:
autopep8
--ignore=E501 --max-line-length=110
Pydev
python 3.10
using pylint
Also, I'm running in a virtual python environment
Please let me know if other info is needed.
I can't seem to get autopep8 (or pylint if that is possible) to take any inputs.
I conclude there is no way to suppress or modify pep8 telling you that your linelength is longer than 80 characters as I've had zero solutions recommended. I also conclude that pep8 is not being actively worked on.
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
So I git cloned the repository to ~/.vim/bundle and had pathogen installed. I can be sure pathogen works fine since my other plugins in bundle are all working fine. After googling for a while, it seems that syntastic should work out of box for c code. I also checked that I have all the executables specified in syntastic/syntax_checkers/c/.
Here is a part of my .vimrc file:
" syntastic
let g:syntastic_auto_loc_list=1
let g:syntastic_disabled_filetypes=['html']
let g:syntastic_enable_signs=1
When I open a *.c file and do :SyntasticCheck, nothing happens. There is no errors complaining command not found, so syntastic is loaded. However, even if the *.c file that's currently opened contains errors syntax error, syntastic is not showing anything.
It is the first time I use syntastic so I don't really know the correct way to invoke it.
I also tried :SyntasticCheck [c] and I get the following error message:
Error detected while processing function <SNR>_22_UpdateErrors..<SNR>22_CacheErrors:
line 16:
E121: Undefined variable: checkers
E15: Invalid expression: checkers
Can someone tell me what I did wrong and how to invoke syntastic?
Thanks!
Try adding this to your vimrc:
let g:syntastic_check_on_open=1
let g:syntastic_enable_signs=1
(This is lifted straight from my vimrc, which has some other Syntastic settings if you'd like.)
I don't really understand the reason, but when I re-installed the YouCompleteMe plugin for vim with ./install.sh --clang-completer. Syntastic works like charm.
Installing clang and/or ctags packages fixed this for me
I did two things and then Syntastic started to behave as expected with JS files and ESlint. Can't tell which one did the trick:
1- In the project's directory ran eslint --init.
2- Started vim opening the file without the -S flag.
Before it failed silently, no errors and no diagnostics. This is how ESlint behaves when there is no configuration file.
Syntastic works for me in general (say, if I edit C/C++ files then I get syntax error notifications), but I can't get it to show syntax errors for OCaml.
My OCaml install seems fine otherwise, and the binaries that are mentioned in the header of Syntastic's ocaml.vim file are in my path.
Any ideas?
The most likely reason is that none of the syntax checkers that it requires is installed. For example: python requires either flake8, pyflakes or pylint to be installed and in $PATH. To see which executables are supported, just look in syntax_checkers//*.vim. Note that aliases do not work; the actual executable must be available in your $PATH. Symbolic links are okay. You can see syntastic's idea of available checkers by running :SyntasticInfo.
Another reason it could fail is that either the command line options or the error output for a syntax checker may have changed. In this case, make sure you have the latest version of the syntax checker installed. If it still fails then create an issue - or better yet, create a pull request
Source:
https://github.com/scrooloose/syntastic
Merlin provides much more complete checking than Syntastic's included checker and will give proper type errors and let you use packages outside of core.
i tried to use this python compiler plugin to be able to "compile" a py script and see the errors in qucikfix windows and jump directly to the linenumers.
http://www.vim.org/scripts/script.php?script_id=1439
i placed it in /compiler/python.vim
but: the script is not loaded when i open a python file. even :filetype detect doesnt help.
(according to :scriptnames)
i also tried to put the stuff into _vimrc. but it is overwritten by some other stuff thats useless. i dont know where it comes from i searched all plugin directories but there is no plugin that does set makeprg and errorformat!
im lost. plz help.
thanks!
Compiler-plugins are never loaded automatically. You'll have to load it explicitly with :compiler python.
you could add this to your filetype.vim file:
autocmd! BufRead,BufNewFile *.py compiler python