mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-24 08:06:26 +01:00
Add yapf to travis and updates CONTRIBUTING doc #259
This commit is contained in:
parent
49122d6a99
commit
e57e6dd645
3 changed files with 20 additions and 6 deletions
|
@ -13,6 +13,7 @@ install:
|
|||
- pip install -r requirements-dev.txt
|
||||
script:
|
||||
- nosetests -v --with-flaky --no-flaky-report --with-coverage --cover-package=telegram/
|
||||
- yapf -r telegram
|
||||
- flake8 telegram
|
||||
- 'if [[ $TRAVIS_PYTHON_VERSION != 2.6 ]]; then pylint -E telegram --disable=no-name-in-module,import-error; fi'
|
||||
after_success:
|
||||
|
|
|
@ -22,6 +22,11 @@ Setting things up
|
|||
|
||||
``$ pip install -r requirements.txt -r requirements-dev.txt``
|
||||
|
||||
|
||||
5. Install pre-commit hooks:
|
||||
|
||||
``$ pre-commit install``
|
||||
|
||||
Finding something to do
|
||||
-----------------------
|
||||
|
||||
|
@ -68,18 +73,20 @@ Here's how to make a one-off code change.
|
|||
|
||||
- Add yourself to the AUTHORS.rst_ file in an alphabetical fashion.
|
||||
|
||||
- Before making a commit ensure that all automated tests, pep8 & lint validations still pass:
|
||||
- Before making a commit ensure that all automated tests still pass:
|
||||
|
||||
``$ make test``
|
||||
|
||||
``$ make pep8``
|
||||
- To actually make the commit (this will trigger test for yapf, lint and pep8 automatically):
|
||||
|
||||
``$ make lint``
|
||||
``$ git add your-file-changed.py``
|
||||
|
||||
- To actually make the commit and push it to your GitHub fork, run:
|
||||
- yapf may change code formatting, make sure to re-add them to your commit.
|
||||
|
||||
``$ git commit -a -m "your-commit-message-here"``
|
||||
|
||||
- Finally, push it to your GitHub fork, run:
|
||||
|
||||
``$ git push origin your-branch-name``
|
||||
|
||||
4. **When your feature is ready to merge, create a pull request.**
|
||||
|
|
10
Makefile
10
Makefile
|
@ -1,10 +1,11 @@
|
|||
.DEFAULT_GOAL := help
|
||||
.PHONY: clean pep8 lint test install
|
||||
.PHONY: clean pep257 pep8 yapf lint test install
|
||||
|
||||
PYLINT := pylint
|
||||
NOSETESTS := nosetests
|
||||
PEP257 := pep257
|
||||
PEP8 := flake8
|
||||
YAPF := yapf
|
||||
PIP := pip
|
||||
|
||||
clean:
|
||||
|
@ -19,7 +20,10 @@ pep257:
|
|||
$(PEP257) telegram
|
||||
|
||||
pep8:
|
||||
$(PEP8) telegram
|
||||
$(PEP8) telegram
|
||||
|
||||
yapf:
|
||||
$(YAPF) -r telegram
|
||||
|
||||
lint:
|
||||
$(PYLINT) -E telegram --disable=no-name-in-module,import-error
|
||||
|
@ -36,6 +40,7 @@ help:
|
|||
@echo "- pep257 Check docstring style with pep257"
|
||||
@echo "- pep8 Check style with flake8"
|
||||
@echo "- lint Check style with pylint"
|
||||
@echo "- yapf Check style with yapf"
|
||||
@echo "- test Run tests"
|
||||
@echo
|
||||
@echo "Available variables:"
|
||||
|
@ -43,4 +48,5 @@ help:
|
|||
@echo "- NOSETESTS default: $(NOSETESTS)"
|
||||
@echo "- PEP257 default: $(PEP257)"
|
||||
@echo "- PEP8 default: $(PEP8)"
|
||||
@echo "- YAPF default: $(YAPF)"
|
||||
@echo "- PIP default: $(PIP)"
|
||||
|
|
Loading…
Reference in a new issue