File tree Expand file tree Collapse file tree 3 files changed +20
-6
lines changed
Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ install:
1313 - pip install -r requirements-dev.txt
1414script :
1515 - nosetests -v --with-flaky --no-flaky-report --with-coverage --cover-package=telegram/
16+ - yapf -r telegram
1617 - flake8 telegram
1718 - ' if [[ $TRAVIS_PYTHON_VERSION != 2.6 ]]; then pylint -E telegram --disable=no-name-in-module,import-error; fi'
1819after_success :
Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ Setting things up
2222
2323 ``$ pip install -r requirements.txt -r requirements-dev.txt ``
2424
25+
26+ 5. Install pre-commit hooks:
27+
28+ ``$ pre-commit install ``
29+
2530Finding something to do
2631-----------------------
2732
@@ -68,18 +73,20 @@ Here's how to make a one-off code change.
6873
6974 - Add yourself to the AUTHORS.rst _ file in an alphabetical fashion.
7075
71- - Before making a commit ensure that all automated tests, pep8 & lint validations still pass:
76+ - Before making a commit ensure that all automated tests still pass:
7277
7378 ``$ make test ``
7479
75- `` $ make pep8``
80+ - To actually make the commit (this will trigger test for yapf, lint and pep8 automatically):
7681
77- ``$ make lint ``
82+ ``$ git add your-file-changed.py ``
7883
79- - To actually make the commit and push it to your GitHub fork, run:
84+ - yapf may change code formatting, make sure to re-add them to your commit.
8085
8186 ``$ git commit -a -m "your-commit-message-here" ``
8287
88+ - Finally, push it to your GitHub fork, run:
89+
8390 ``$ git push origin your-branch-name ``
8491
85924. **When your feature is ready to merge, create a pull request. **
Original file line number Diff line number Diff line change 11.DEFAULT_GOAL := help
2- .PHONY : clean pep8 lint test install
2+ .PHONY : clean pep257 pep8 yapf lint test install
33
44PYLINT := pylint
55NOSETESTS := nosetests
66PEP257 := pep257
77PEP8 := flake8
8+ YAPF := yapf
89PIP := pip
910
1011clean :
@@ -19,7 +20,10 @@ pep257:
1920 $(PEP257 ) telegram
2021
2122pep8 :
22- $(PEP8 ) telegram
23+ $(PEP8 ) telegram
24+
25+ yapf :
26+ $(YAPF ) -r telegram
2327
2428lint :
2529 $(PYLINT ) -E telegram --disable=no-name-in-module,import-error
@@ -36,11 +40,13 @@ help:
3640 @echo " - pep257 Check docstring style with pep257"
3741 @echo " - pep8 Check style with flake8"
3842 @echo " - lint Check style with pylint"
43+ @echo " - yapf Check style with yapf"
3944 @echo " - test Run tests"
4045 @echo
4146 @echo " Available variables:"
4247 @echo " - PYLINT default: $( PYLINT) "
4348 @echo " - NOSETESTS default: $( NOSETESTS) "
4449 @echo " - PEP257 default: $( PEP257) "
4550 @echo " - PEP8 default: $( PEP8) "
51+ @echo " - YAPF default: $( YAPF) "
4652 @echo " - PIP default: $( PIP) "
You can’t perform that action at this time.
0 commit comments