Skip to content

Commit

Permalink
Merge f8d8022 into 78a2e8a
Browse files Browse the repository at this point in the history
  • Loading branch information
khink committed Mar 24, 2017
2 parents 78a2e8a + f8d8022 commit 3022415
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/contributing/python_guidelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ Python coding guidelines
PEP8
~~~~

We ask that all Python contributions adhere to the `PEP8 <http://www.python.org/dev/peps/pep-0008/>`_ style guide, apart from the restriction on line length (E501). In addition, import lines should be sorted according to `isort <http://timothycrosley.github.io/isort/>`_ rules. If you have installed Wagtail's testing dependencies (``pip install -e .[testing]``), you can check your code by running ``make lint``.
We ask that all Python contributions adhere to the `PEP8 <http://www.python.org/dev/peps/pep-0008/>`_ style guide, apart from the restriction on line length (E501) and some minor docstring-related issues.
The list of PEP8 violations to ignore is in the ``tox.ini`` file, under the ``[flake8]`` header.
You might want to configure the flake8 linter in your editor/IDE to use the configuration in this file.

In addition, import lines should be sorted according to `isort <http://timothycrosley.github.io/isort/>`_ rules. If you have installed Wagtail's testing dependencies (``pip install -e .[testing]``), you can check your code by running ``make lint``.


Python 2 and 3 compatibility
Expand Down
19 changes: 19 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ envlist = py{27,34,35}-dj{18,110,110head}-{sqlite,postgres,mysql}-{elasticsearch
py{27,34,35,36}-dj111-{sqlite,postgres,mysql}-{elasticsearch5,elasticsearch2,elasticsearch,noelasticsearch},
flake8

[flake8]
# D100: Missing docstring in public module
# D101: Missing docstring in public class
# D102: Missing docstring in public method
# D103: Missing docstring in public function
# D105: Missing docstring in magic method
# D200: One-line docstring should fit on one line with quotes
# D202: No blank lines allowed after function docstring
# D204: 1 blank line required after docstring
# D205: 1 blank line required between summary line and description
# D209: Multi-line docstring cloasing quotes should be on a separate line
# D400: First line should end with a period
# D401: First line should be in imperative mood
# E303: Too many blank lines
# E501: Line too long
# N805: First argument of a method should be named 'self'
# N806: Variable in function should be lowercase
ignore = D100,D101,D102,D103,D105,D200,D202,D204,D205,D209,D400,D401,E303,E501,N805,N806

[testenv]
install_command = pip install -e ".[testing]" -U {opts} {packages}
commands =
Expand Down

0 comments on commit 3022415

Please sign in to comment.