14

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?

suci
  • 178
  • 7
rgrinberg
  • 9,638
  • 7
  • 27
  • 44

2 Answers2

23

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.

Christian Geier
  • 2,059
  • 2
  • 21
  • 27
  • 3
    As far as I am concerned, flake8 is powerful than pylint. Maybe `let g:syntastic_python_flake8_args='--ignore=E501,E225'` is enough for `flake8` only. – Kamel Jul 24 '14 at 05:19
  • 6
    Here are all the pep8 errors, add them to effectively disable pep8: '--ignore=E101,E111,E112,E113,E114,E115,E116,E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E133,E201,E202,E203,E211,E221,E222,E223,E224,E225,E226,E227,E228,E231,E241,E242,E251,E261,E262,E265,E266,E271,E272,E273,E274,E301,E302,E303,E304,E401,E402,E501,E502,E701,E702,E703,E704,E711,E712,E713,E714,E721,E731,E901,E902,W191,W291,W292,W293,W391,W503,W601,W602,W603,W604' – Lucas Jul 27 '15 at 10:03
  • 1
    Dead link for error codes. Flake8 specific ones are here: http://flake8.readthedocs.io/en/latest/user/error-codes.html pycodestyle (used to be pep8) are here: https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes – JoshB Aug 25 '16 at 07:55
  • 2
    @Lucas you can use error classes, such as E1 for all E1xx warnings. – qwr Oct 05 '16 at 17:14
6

Adding to Christians answer. You can also add specific checker args:

let g:syntastic_python_flake8_args = "--ignore=E501 --max-complexity 10"
oz123
  • 27,559
  • 27
  • 125
  • 187