Skip to content

Commit

Permalink
Merge branch 'master' into docstring_support
Browse files Browse the repository at this point in the history
  • Loading branch information
brianv0 committed May 8, 2018
2 parents aa0a32b + 11ba4cc commit f71d30f
Show file tree
Hide file tree
Showing 21 changed files with 1,000 additions and 127 deletions.
46 changes: 43 additions & 3 deletions CHANGES.txt
@@ -1,12 +1,52 @@
Changelog
=========

UNRELEASED
----------
2.4.0 (2018-04-10)
------------------

New checks:

* Add W605 warning for invalid escape sequences in string literals
* Add W504 warning for checking that a break doesn't happen after a binary
operator. This check is ignored by default. PR #502.
* Add W605 warning for invalid escape sequences in string literals. PR #676.
* Add W606 warning for 'async' and 'await' reserved keywords being introduced
in Python 3.7. PR #684.
* Add E252 error for missing whitespace around equal sign in type annotated
function arguments with defaults values. PR #717.

Changes:

* An internal bisect search has replaced a linear search in order to improve
efficiency. PR #648.
* pycodestyle now uses PyPI trove classifiers in order to document supported
python versions on PyPI. PR #654.
* 'setup.cfg' '[wheel]' section has been renamed to '[bdist_wheel]', as
the former is legacy. PR #653.
* pycodestyle now handles very long lines much more efficiently for python
3.2+. Fixes #643. PR #644.
* You can now write 'pycodestyle.StyleGuide(verbose=True)' instead of
'pycodestyle.StyleGuide(verbose=True, paths=['-v'])' in order to achieve
verbosity. PR #663.
* The distribution of pycodestyle now includes the license text in order to
comply with open source licenses which require this. PR #694.
* 'maximum_line_length' now ignores shebang ('#!') lines. PR #736.
* Add configuration option for the allowed number of blank lines. It is
implemented as a top level dictionary which can be easily overwritten. Fixes
#732. PR #733.

Bugs:

* Prevent a 'DeprecationWarning', and a 'SyntaxError' in future python, caused
by an invalid escape sequence. PR #625.
* Correctly report E501 when the first line of a docstring is too long.
Resolves #622. PR #630.
* Support variable annotation when variable start by a keyword, such as class
variable type annotations in python 3.6. PR #640.
* pycodestyle internals have been changed in order to allow 'python3 -m
cProfile' to report correct metrics. PR #647.
* Fix a spelling mistake in the description of E722. PR #697.
* 'pycodestyle --diff' now does not break if your 'gitconfig' enables
'mnemonicprefix'. PR #706.

2.3.1 (2017-01-31)
------------------
Expand Down
38 changes: 38 additions & 0 deletions CONTRIBUTING.rst
Expand Up @@ -66,6 +66,44 @@ At this point you can create a pull request back to the official pycodestyles
repository for review! For more information on how to make a pull request,
GitHub has an excellent `guide`_.

The current tests are written in 2 styles:

* standard xUnit based only on stdlib unittest
(can be executed with nose)
* functional test using a custom framework and executed by the
pycodestyle itself when installed in dev mode.


Running unittest
~~~~~~~~~~~~~~~~

While the tests are writted using stdlib `unittest` module, the existing
test include unit, integration and functional tests.

There are a couple of ways to run the tests::

$ python setup.py test
$ # Use nose to run specific test
$ nosetests \
> testsuite.test_blank_lines:TestBlankLinesDefault.test_initial_no_blank
$ # Use nose to run a subset and check coverage, and check the resulting
$ $ cover/pycodestyle_py.html in your browser
$ nosetests --with-coverage --cover-html -s testsuite.test_blank_lines


Running functional
~~~~~~~~~~~~~~~~~~

When installed in dev mode, pycodestyle will have the `--testsuite`
option which can be used to run the tests::

$ pip install -e .
$ # Run all tests.
$ pycodestyle --testsuite testsuite
$ # Run a subset of the tests.
$ pycodestyle --testsuite testsuite/E30.py


.. _virtualenv: http://docs.python-guide.org/en/latest/dev/virtualenvs/
.. _guide: https://guides.github.com/activities/forking/
.. _tox: https://tox.readthedocs.io/en/latest/
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
Copyright © 2006-2009 Johann C. Rocholl <johann@rocholl.net>
Copyright © 2009-2014 Florent Xicluna <florent.xicluna@gmail.com>
Copyright © 2014-2016 Ian Lee <IanLee1521@gmail.com>
Copyright © 2014-2018 Ian Lee <IanLee1521@gmail.com>

Licensed under the terms of the Expat License

Expand Down
4 changes: 2 additions & 2 deletions docs/developer.rst
Expand Up @@ -14,7 +14,7 @@ conditions of the :ref:`Expat license <license>`. Fork away!
* `Source code <https://github.com/pycqa/pycodestyle>`_ and
`issue tracker <https://github.com/pycqa/pycodestyle/issues>`_ on GitHub.
* `Continuous tests <http://travis-ci.org/pycqa/pycodestyle>`_ against Python
2.6 through 3.5 as well as the nightly Python build and PyPy, on `Travis-CI
2.6 through 3.6 as well as the nightly Python build and PyPy, on `Travis CI
platform <https://docs.travis-ci.com//>`_.

.. _available on GitHub: https://github.com/pycqa/pycodestyle
Expand Down Expand Up @@ -104,7 +104,7 @@ Then be sure to pass the tests::

When contributing to pycodestyle, please observe our `Code of Conduct`_.

To run the tests, the core developer team and Travis-CI use tox::
To run the tests, the core developer team and Travis CI use tox::

$ pip install -r dev-requirements.txt
$ tox
Expand Down
17 changes: 12 additions & 5 deletions docs/intro.rst
Expand Up @@ -404,7 +404,9 @@ This is the current list of error and warning codes:
+------------+----------------------------------------------------------------------+
| **W5** | *Line break warning* |
+------------+----------------------------------------------------------------------+
| W503 (*) | line break occurred before a binary operator |
| W503 (*)   | line break before binary operator                         |
+------------+----------------------------------------------------------------------+
| W504 (*)   | line break after binary operator                         |
+------------+----------------------------------------------------------------------+
| W505 (\*^) | doc line too long (82 > 79 characters) |
+------------+----------------------------------------------------------------------+
Expand All @@ -421,13 +423,18 @@ This is the current list of error and warning codes:
+------------+----------------------------------------------------------------------+
| W605 | invalid escape sequence '\x' |
+------------+----------------------------------------------------------------------+
| W606 | 'async' and 'await' are reserved keywords starting with Python 3.7 |
+------------+----------------------------------------------------------------------+


**(*)** In the default configuration, the checks **E121**, **E123**, **E126**,
**E133**, **E226**, **E241**, **E242**, **E704** and **W503** are ignored because
they are not rules unanimously accepted, and `PEP 8`_ does not enforce them. The
check **E133** is mutually exclusive with check **E123**. Use switch
``--hang-closing`` to report **E133** instead of **E123**. Use switch
**E133**, **E226**, **E241**, **E242**, **E704**, **W503** and **W504** are ignored
because they are not rules unanimously accepted, and `PEP 8`_ does not enforce them.
Please note that if the option **--ignore=errors** is used,
the default configuration will be overridden and ignore only the check(s) you skip.
The check **W503** is mutually exclusive with check **W504**.
The check **E133** is mutually exclusive with check **E123**. Use switch
``--hang-closing`` to report **E133** instead of **E123**. Use switch
``--max-doc-length=n`` to report **W505**.

**(^)** These checks can be disabled at the line level using the ``# noqa``
Expand Down

0 comments on commit f71d30f

Please sign in to comment.