動作環境
Raspberry Pi 2 Model B (以下RPi)
Raspbian Jessie
Python 2.7.9
Raspberry Pi > editor > geany > Cの実装に使ってみる
にてCの実装にgeanyを使い始めた。
geanyの1つの問題は、空白とタブのインデントが明白でない点。
また、行末の空白が明示されない点。
gitリポジトリにpushする前にチェックして修正したい。
PEP8
PythonのコードチェックのPEP8を使う。
$ pep8 i2c_gpio_180309.c | grep mixed
i2c_gpio_180309.c:22:1: E101 indentation contains mixed spaces and tabs
i2c_gpio_180309.c:23:1: E101 indentation contains mixed spaces and tabs
22行目でタブインデントがある。
(空白4つのインデントで実装している)。
$ pep8 i2c_gpio_180309.c | grep trail
i2c_gpio_180309.c:14:36: W291 trailing whitespace
i2c_gpio_180309.c:20:44: W291 trailing whitespace
14行目と20行目に行末の空白がある。
C/C++用のチェックツールは未確認。