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:
13
13
- pip install -r requirements-dev.txt
14
14
script :
15
15
- nosetests -v --with-flaky --no-flaky-report --with-coverage --cover-package=telegram/
16
+ - yapf -r telegram
16
17
- flake8 telegram
17
18
- ' if [[ $TRAVIS_PYTHON_VERSION != 2.6 ]]; then pylint -E telegram --disable=no-name-in-module,import-error; fi'
18
19
after_success :
Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ Setting things up
22
22
23
23
``$ pip install -r requirements.txt -r requirements-dev.txt ``
24
24
25
+
26
+ 5. Install pre-commit hooks:
27
+
28
+ ``$ pre-commit install ``
29
+
25
30
Finding something to do
26
31
-----------------------
27
32
@@ -68,18 +73,20 @@ Here's how to make a one-off code change.
68
73
69
74
- Add yourself to the AUTHORS.rst _ file in an alphabetical fashion.
70
75
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:
72
77
73
78
``$ make test ``
74
79
75
- `` $ make pep8``
80
+ - To actually make the commit (this will trigger test for yapf, lint and pep8 automatically):
76
81
77
- ``$ make lint ``
82
+ ``$ git add your-file-changed.py ``
78
83
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.
80
85
81
86
``$ git commit -a -m "your-commit-message-here" ``
82
87
88
+ - Finally, push it to your GitHub fork, run:
89
+
83
90
``$ git push origin your-branch-name ``
84
91
85
92
4. **When your feature is ready to merge, create a pull request. **
Original file line number Diff line number Diff line change 1
1
.DEFAULT_GOAL := help
2
- .PHONY : clean pep8 lint test install
2
+ .PHONY : clean pep257 pep8 yapf lint test install
3
3
4
4
PYLINT := pylint
5
5
NOSETESTS := nosetests
6
6
PEP257 := pep257
7
7
PEP8 := flake8
8
+ YAPF := yapf
8
9
PIP := pip
9
10
10
11
clean :
@@ -19,7 +20,10 @@ pep257:
19
20
$(PEP257 ) telegram
20
21
21
22
pep8 :
22
- $(PEP8 ) telegram
23
+ $(PEP8 ) telegram
24
+
25
+ yapf :
26
+ $(YAPF ) -r telegram
23
27
24
28
lint :
25
29
$(PYLINT ) -E telegram --disable=no-name-in-module,import-error
@@ -36,11 +40,13 @@ help:
36
40
@echo " - pep257 Check docstring style with pep257"
37
41
@echo " - pep8 Check style with flake8"
38
42
@echo " - lint Check style with pylint"
43
+ @echo " - yapf Check style with yapf"
39
44
@echo " - test Run tests"
40
45
@echo
41
46
@echo " Available variables:"
42
47
@echo " - PYLINT default: $( PYLINT) "
43
48
@echo " - NOSETESTS default: $( NOSETESTS) "
44
49
@echo " - PEP257 default: $( PEP257) "
45
50
@echo " - PEP8 default: $( PEP8) "
51
+ @echo " - YAPF default: $( YAPF) "
46
52
@echo " - PIP default: $( PIP) "
You can’t perform that action at this time.
0 commit comments