11Contributing
22------------
33
4- Instructions
4+ Requirements
55============
66
7- Before submitting a pull request on GitHub _, please make sure you meet the
8- following **requirements **:
9-
10- * The pull request points to the dev _ (development) branch.
11- * All changes are squashed into a single commit (I like to use ``git rebase -i ``
12- to do this).
13- * The commit message is in present tense (good: "Add feature", bad:
14- "Added feature").
15- * Correct and consistent style: Sphinx _-compatible docstrings, correct snake
16- and camel casing, and PEP8 _ compliance (see below).
17- * No classes/methods/functions with missing docstrings or commented-out lines.
18- You can take a look at the source code on GitHub _ for examples.
19- * The test coverage _ remains at %100. You may find yourself having to write
20- superfluous unit tests to keep this number up. If a piece of code is trivial
21- and has no need for tests, use this _ to exclude it from coverage.
22- * No build failures on TravisCI _. The builds automatically trigger on PR
23- submissions.
24- * Does not break backward-compatibility (unless there is a really good reason).
25- * Compatibility with all supported Python versions: 2.7, 3.4, 3.5 and 3.6.
26-
27- .. warning ::
28- The dev branch is occasionally rebased _, and its commit history may be
29- overwritten in the process. Before you begin feature work, git fetch or
30- pull to ensure that your local branch has not diverged. If you see git
31- conflicts and just want to start from scratch, run these commands:
32-
33- .. code-block :: bash
34-
35- ~ $ git checkout dev
36- ~ $ git fetch origin
37- ~ $ git reset --hard origin/dev # THIS WILL WIPE ALL LOCAL CHANGES
7+ When submitting a pull request, please ensure your changes meet the following
8+ requirements:
9+
10+ * Pull request points to dev _ (development) branch.
11+ * Changes are squashed into a single commit.
12+ * Commit message is in present tense (e.g. "Add foo" over "Added foo").
13+ * Sphinx _-compatible docstrings.
14+ * PEP8 _ compliance.
15+ * Test coverage _ remains at %100.
16+ * No build failures on TravisCI _.
17+ * Up-to-date documentation (see below).
18+ * Maintains backward-compatibility.
19+ * Maintains compatibility with Python 2.7+ and 3.4+.
3820
3921Style
4022=====
4123
42- To ensure PEP8 _ compliance, run flake8 _ :
24+ Run flake8 _ to check style :
4325
4426.. code-block :: bash
4527
@@ -48,17 +30,11 @@ To ensure PEP8_ compliance, run flake8_:
4830 ~ $ cd binarytree
4931 ~ $ flake8
5032
51- You must resolve all issues reported. If there is a good reason to ignore
52- errors coming from a specific piece of code, visit here _ to see how to exclude
53- the lines.
5433
5534 Testing
5635=======
5736
58- To test your changes, run the unit tests that come with **binarytree ** on your
59- local machine. The tests use pytest _.
60-
61- To run the unit tests:
37+ Run unit tests:
6238
6339.. code-block :: bash
6440
@@ -67,44 +43,35 @@ To run the unit tests:
6743 ~ $ cd binarytree
6844 ~ $ py.test --verbose
6945
70- To run the unit tests with coverage report :
46+ Run unit tests with coverage:
7147
7248.. code-block :: bash
7349
7450 ~ $ pip install coverage pytest pytest-cov
7551 ~ $ git clone https://github.com/joowani/binarytree.git
7652 ~ $ cd binarytree
77- ~ $ py.test --verbose -- cov=binarytree --cov-report=html
53+ ~ $ py.test --cov=binarytree --cov-report=html
7854
7955 # Open the generated file htmlcov/index.html in a browser
8056
8157 Documentation
8258=============
8359
84- The documentation (including the README) is written in reStructuredText _ and
85- uses Sphinx _. To build an HTML version of the documentation on your local
86- machine:
60+ Documentation uses reStructuredText _ and Sphinx _. To build locally:
8761
8862.. code-block :: bash
8963
9064 ~ $ pip install sphinx sphinx_rtd_theme
9165 ~ $ git clone https://github.com/joowani/binarytree.git
9266 ~ $ cd binarytree/docs
9367 ~ $ sphinx-build . build
68+ # Open build/index.html in a browser
9469
95- # Open the generated file build/index.html in a browser
96-
97- As always, thank you for your contribution!
9870
99- .. _rebased : https://git-scm.com/book/en/v2/Git-Branching-Rebasing
10071 .. _dev : https://github.com/joowani/binarytree/tree/dev
101- .. _GitHub : https://github.com/joowani/binarytree
10272.. _PEP8 : https://www.python.org/dev/peps/pep-0008/
10373.. _coverage : https://coveralls.io/github/joowani/binarytree
104- .. _this : http://coverage.readthedocs.io/en/latest/excluding.html
10574.. _TravisCI : https://travis-ci.org/joowani/binarytree
10675.. _Sphinx : https://github.com/sphinx-doc/sphinx
10776.. _flake8 : http://flake8.pycqa.org
108- .. _here : http://flake8.pycqa.org/en/latest/user/violations.html#in-line-ignoring-errors
109- .. _pytest : https://github.com/pytest-dev/pytest
11077.. _reStructuredText : https://en.wikipedia.org/wiki/ReStructuredText
0 commit comments