pythonvimpylintpython-modesyntastic

How can I set the Python max allowed line length to 120 in Syntastic for Vim?


I'm using python-mode for Vim, I prefer for there to be 120 character lines rather than the stark 80 as defined in the PEP8 standard.

In python-mode, this is easy. I just add the following to my ~/.vimrc:

" Pylint configuration file
let g:pymode_lint_config = '$HOME/.pylint.rc'
let g:pymode_options_max_line_length=120

This works great, but then, I also wanted to use the superb Syntastic plugin for checking syntax of various other kinds (Chef recipes for foodcritic, for example.)

Unfortunately, Syntastic also does Python linting, and as such it has now started complaining about my 120 character lines. Is there something similar I can do to it as well to make it stop complaining about my slightly longer lines?


Solution

  • You can pass additional arguments to each linter. For pylint, you can use:

    let g:syntastic_python_pylint_post_args="--max-line-length=120"