pylint in Vim

I’m a big fan of Vim and I do lots of Python programming and I like to ensure my code passes static analysis (using pylint).  To hook these together I added the following to my .vimrc file.

autocmd FileType python set makeprg=pylint\ --reports=n\ --msg-template=\"{path}:{line}:\ {msg_id}\ {symbol},\ {obj}\ {msg}\"\ %:p
autocmd FileType python set errorformat=%f:%l:\ %m

When you have a python file open :make runs pylint and shows the results in the quickfix window so you can jump to the line with the problem.

Vim pylint integration

  2Comments

  1. Joseph Reddington   •  

    Thank you – just what I was looking for, now in my vimrc 🙂

  2. bob   •  

    Awesome, how do you automatically get the quickfix window?

    I had to add an extra line to vimrc:
    nmap ,m :makecopen

Leave a Reply

Your email address will not be published. Required fields are marked *