pylintの設定
標準設定だとpylintの警告がうるさいのでいくつかの警告を無視したい.
pylintrcの設置
以下のコマンドで.pylintrcを設置:
$ pylint --generate-rcfile > ~/.pylintrc
警告を無視する
.pylintrcのdisable以下に無視する警告のコードを追加する.(コード一覧) missing-docstringやinvalid-nameはうるさいし普段は必要ないから追加しておくといいかな.
code: ~/.pylintrc
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=print-statement,
parameter-unpacking,
unpacking-in-except,
old-raise-syntax,
backtick,
...
vim(Syntastic)の設定
以下のコマンドで現在の設定を確認.
code: vim
:SyntasticInfo
Syntastic version: 3.5.0-72
Info for filetype: python
Global mode: active
Filetype python is active
The current file will be checked automatically
Available checkers: pep8 pylint python
Currently enabled checkers: python pylint
pylintを使用するように設定.
code: .vimrc
let g:syntastic_python_checkers = 'pylint' ...
これでpylintが使われるように設定できた.:SyntasticInfoで確認して見るといい.