13

How to use synstastic in vim to display only pylint error messages? I basically want the output of pylint -E to be used as source for syntastic. I tried to configure syntastic in my .vimrc with:

 let g:syntastic_python_checkers = ['python', 'pylint -E']

which did not work. Also, I tried to configure pylint to show only errors without the -E flag via the following lines in my .pylintrc:

disable=all
enable=E

which seems to be only disable=all.

zormit
  • 533
  • 4
  • 16

3 Answers3

12

It works by disabling all other categories in .pylintrc:

disable=C, F, I, R, W
zormit
  • 533
  • 4
  • 16
  • 8
    If you are to add this line only just remember to add [MESSAGES CONTROL] above that line. (For those who are googling in hurry :) ) – chanux Oct 26 '15 at 07:17
7

Wanted to add a different type of answer, since I was able to get this to work:

Adding arguments to syntastic works a little differently than as mentioned by OP. Instead, what I have is, in my .vimrc:

let g:syntastic_python_checkers = ['pylint']  "" or ['flake8', 'pylint'], etc
let g:syntastic_python_pylint_args = '-E'
"" to show it accepts a string of args, also:
let g:syntastic_python_pylint_args = '--rcfile=/path/to/rc -E'
dwanderson
  • 2,775
  • 2
  • 25
  • 40
3

from https://github.com/scrooloose/syntastic/blob/master/doc/syntastic.txt

let g:syntastic_quiet_messages = {
        \ "!level":  "errors",
        \ "type":    "style",
        \ "regex":   '.*',
        \ "file:p":  '.*' }

That would ignore all style warnings in all file types. Note the ! in !level. You can also put 'type':['style', 'syntax'], but in general it's not a good idea to ignore syntax warnings.

Slava
  • 1,528
  • 1
  • 15
  • 23