らんだむな記憶

blogというものを体験してみようか!的なー

python hacking

という大袈裟なものでもなく。

$ pip install hacking

でflake8のプラグインのhackingごとインストール。
設定ファイルは ~/.config/flake8 という噂があるがどうもうまく動作しないので flake8 のヘルプを見ると、

Configuration:
The project options are read from the [flake8] section of the tox.ini
file or the setup.cfg file located in any parent folder of the path(s)
being processed. Allowed options are: exclude, filename, select,
ignore, max-line-length, hang-closing, count, format, quiet, show-
pep8, show-source, statistics, verbose, jobs, builtins, doctests,
include-in-doctest, exclude-from-doctest, max-complexity, output-file,
enable-extensions.

とな。
なので、適当な上位ディレクトリに tox.ini を作って [flake8] を書いて、適当に設定をずらずら書いたらOKだった。

[flake8]
ignore = E201,E202,E221,E301,E401,H301
max-line-length = 160

くらいと書いておけば、1行あたり79文字までーとかぎゃーすか(とか私的につまらないと思う指摘を)言われなくて済む。