sublimetext2 で pylint (pylinter) 使ってみた

やぁ。
オフィスでも家でもメインエディタになった、
「sublime text 2」で pylint 使ってみたメモ。
なんかsublimeLinterでpylint使うとか、そんなカッコイイやり方、
できそうやけど、やり方わからんかった。
sublimetext の pylinter も、日本語の情報が少なすぎて…。
(環境 windows 7 + python 2.6 + pylint 0.26.0 + sublime text2)

手順


1 pylintインストール
このあたりから。
http://pypi.python.org/pypi/pylint
2 pylinterインストール
御多分にもれず、Sublime Package Control から、install package で、
pylinter をインストール
3 pylinter 設定(以下はぼくの場合)

{
// When versbose is 'true', various messages will be written to the console.
// values: true or false
"verbose": false,
// The full path to the Python executable you want to
// run Pylint with or simply use 'python'.
"python_bin": "python",
// The following paths will be added Pylint's Python path
"python_path": [
"C:\\Python25\\"
],
// Optionally set the working directory
"working_dir": "C:\\dev\\trunk\\project\\",
// Full path to the lint.py module in the pylint package
"pylint_path": "C:\\Python25\\Lib\\site-packages\\pylint\\lint.py",
// Optional full path to a Pylint configuration file
"pylint_rc": null,
// Set to true to automtically run Pylint on save
"run_on_save": true,
// Set to true to use graphical error icons
"use_icons": true,
"disable_outline": false,
// Status messages stay as long as cursor is on an error line
"message_stay": true,
// Ignore Pylint error types. Possible values:
// "R" : Refactor for a "good practice" metric violation
// "C" : Convention for coding standard violation
// "W" : Warning for stylistic problems, or minor programming issues
// "E" : Error for important programming issues (i.e. most probably bug)
// "F" : Fatal for errors which prevented further processing

"ignore": [],
// a list of strings of individual errors to disable, ex: ["C0301"]
"disable": []
}

4 sublimetext2再起動
5 done.

補足


これを参考に設定する人は、ディレクトリ関係とかは、適当に脳内変換してね。
pylinterのバージョンとかによっては、デフォルトの設定が変わるかもしらんし、
ほんま参考程度にどうぞ。
あ、sublimetext2 は多分ほかのプラグインもそうやけど、
「Settings - Default」に設定書いちゃうと、たまに消えるかも。
「Settings - User」に書かないと。
Defaultの設定項目をUserでオーバーライドするんやね多分きっと。

0 件のコメント :

コメントを投稿