LoginSignup
1
1

More than 3 years have passed since last update.

Travis CIとGithubでPEP8に準拠したコーディングを行う簡単な方法

Posted at

.travis.yml

リモートリポジトリにpushする時にTravis CIでPEP8に準拠しているかチェックする.

language: python
python:
  - 3.6
intall:
  - pip install pycodestyle
script:
  - find . -name \*.py -exec pycodestyle {} + 

リモートにpushする時

リモートへのpushはdevelopブランチなどmaster以外にする.

git add .
git commit -m 'hoge'
git push origin develop

この時Travisが走り, PEP8に従っていないコードがあったらエラーメッセージが出る.
エラーが出ても構わずpushされるけど, そのままgithub上でmasterにマージしようとすると警告が出るので防止策にはなる。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1