Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
a99bcec
Never use 'l' (lowercase letter el) as a variable name
mtmiller Jun 2, 2016
26893da
Report E741 for prohibited single-letter variables
mtmiller Jun 2, 2016
4c8152c
Add more doctests for E741
mtmiller Jun 2, 2016
017d3b5
Also report E741 on 'global' and 'nonlocal' statements
mtmiller Jun 3, 2016
fdf3e6a
Report E742 and E743 for badly named functions and classes
mtmiller Jun 3, 2016
b98ed7b
Update Python version list in docs
mtmiller Jun 3, 2016
26c64ba
Change all references to the pep8 project to say pycodestyle
ArgentFalcon Jun 2, 2016
77f5543
Merge pull request #530 from iamaspacecow/pycodestyle-name-change
IanLee1521 Jun 6, 2016
c122532
Merge pull request #532 from mtmiller/doc-update
IanLee1521 Jun 6, 2016
64edd89
Bumped version number post release
IanLee1521 Jun 1, 2016
e8d358e
Re-ordered package imports alphabetically
IanLee1521 Jun 1, 2016
adcb3a2
Fix typos
ArcTanSusan Jun 3, 2016
7ffd648
Reverted a few spelling changes
IanLee1521 Jun 6, 2016
5be92ad
Add test-requirements.txt with basic test packages
ArcTanSusan Jun 3, 2016
45503fc
Updated developer documentation for testing
IanLee1521 Jun 6, 2016
fc8c799
Added skip missing interpreters flag to tox config
IanLee1521 Jun 6, 2016
ca7e43b
Fixed wrapping of text in developer.rst
IanLee1521 Jun 6, 2016
42c8987
Added passing test case related to #376
IanLee1521 Jun 3, 2016
d2171cd
Updated docs related to tested Python versions
IanLee1521 Jun 6, 2016
e15075a
Updated Travis CI doc link
IanLee1521 Jun 6, 2016
60859d6
Updated version number of next release to 2.1.0
IanLee1521 Jun 7, 2016
4ccdc55
Merge pull request #525 from mtmiller/issue341
IanLee1521 Jun 7, 2016
6cb59d6
Updated changelog to specify changes in 2.1.0
IanLee1521 Jun 7, 2016
7fa71af
Update maximum_line_length to use Checker.noqa
sigmavirus24 Jun 7, 2016
95ed849
Remove unused imports and assignments
sigmavirus24 Jun 7, 2016
1fcd279
Merge pull request #540 from sigmavirus24/remove-warnings
sigmavirus24 Jun 7, 2016
f8af83d
Merge pull request #539 from sigmavirus24/max-line-length-noqa
IanLee1521 Jun 8, 2016
15b1b42
Updated text about running tests with tox; Closes #552
IanLee1521 Jun 25, 2016
e01ca2f
Updated to use sheilds.io badges
IanLee1521 Jun 25, 2016
5a6ffd5
Updated rename note in README
IanLee1521 Jun 25, 2016
dc08dad
Updated changelog with 2.1 milestone changes
IanLee1521 Jun 25, 2016
6b75c4d
Fix issue #400: Require two blank lines after toplevel def, class
benesch May 20, 2015
f55b1c5
Fixed placement of changelog entry
IanLee1521 Jun 25, 2016
10f4e51
Added extra Okay example to test against
IanLee1521 Jun 25, 2016
2a5e575
Updated checker variable based on conversation in #536
IanLee1521 Jun 25, 2016
a0d5d5d
Added test case based on @gvanrossum comment
IanLee1521 Jun 25, 2016
08f4891
Merge branch 'gh-536'
IanLee1521 Jun 25, 2016
5c4c081
Removed test code unrelated to utf-8 checks
IanLee1521 Jun 25, 2016
4438622
Updated tox to do same tests as Travis CI
IanLee1521 Jun 26, 2016
36e3400
Special case for nested functions an classes (fixes #28)
memeplex Jun 29, 2016
98dee57
Improve error message and add some comments
memeplex Jun 29, 2016
72acd6f
Report E302 for blank lines before an "async def"
markpeek Jul 1, 2016
001a0ce
Merge pull request #556 from markpeek/markpeek-async-def
IanLee1521 Jul 1, 2016
df8a6c0
Add Gitter badge
gitter-badger Jul 3, 2016
0babee5
Merge pull request #557 from gitter-badger/gitter-badge
IanLee1521 Jul 3, 2016
d4b8f49
Stop checking for string option type
sigmavirus24 Jul 25, 2016
1e71012
Merge pull request #562 from sigmavirus24/bug/561
IanLee1521 Jul 25, 2016
0962a10
Add contributing instructions.
daspecster Aug 2, 2016
a090bb2
Feedback changes. Typos and capitalization.
daspecster Aug 2, 2016
66e43b4
Merge pull request #566 from daspecster/update-contributing-rst
sigmavirus24 Aug 2, 2016
39e5718
Merge pull request #555 from memeplex/master
sigmavirus24 Aug 11, 2016
1391c7e
Update CHANGES.txt for 2.1.0 release.
daspecster Sep 18, 2016
e4244fe
Updated changelog from feedback.
daspecster Sep 21, 2016
61f2e4e
Update tested python version notes.
daspecster Sep 21, 2016
24611d1
Merge pull request #574 from daspecster/prepare-2.1.0-changelog
sigmavirus24 Sep 21, 2016
5c4ca67
Fixed line wrapping in CHANGELOG
IanLee1521 Sep 29, 2016
2cc7a8a
Check for both [pep8] and [pycodestyle] config sections.
daspecster Nov 3, 2016
ee9c279
Merge pull request #591 from daspecster/support-pep8-pycodestyle-config
IanLee1521 Nov 3, 2016
2d0b5d9
Updated changelog for #591
IanLee1521 Nov 4, 2016
088adfc
Moved build badges to top of README
IanLee1521 Nov 4, 2016
ae2271b
Added RTD Badge to README
IanLee1521 Nov 4, 2016
4f909cd
Made RTD badge point to base, and use SSL
IanLee1521 Nov 4, 2016
0be4e22
Added missing word to instructions
IanLee1521 Nov 4, 2016
510c690
Tagged release of 2.1.0
IanLee1521 Nov 4, 2016
d12e2ea
Bump versin number post release
IanLee1521 Nov 4, 2016
ce71d1e
Fix E305 regression in 2.1.0 due to fix for #400
markpeek Nov 6, 2016
e5411e1
Merge pull request #593 from markpeek/markpeek-E305fix
sigmavirus24 Nov 7, 2016
349deea
Add E306 to docs
spaceone Nov 7, 2016
ab324d7
Merge pull request #595 from spaceone/patch-1
IanLee1521 Nov 9, 2016
020d6ff
Fixed CHANGELOG release date for v2.1.0
IanLee1521 Nov 14, 2016
659ef94
Added Makefile to handle proper permissions in releases
IanLee1521 Nov 14, 2016
8053c7c
Tagged release of 2.2.0
IanLee1521 Nov 14, 2016
fcc8f58
Prevent E305 on variable names `class*` and `def*`
ParthKolekar Nov 22, 2016
543f12b
warn about bare except clause
rogalski Dec 28, 2016
d7d6154
Merge pull request #592 from rogalski/bare-except
sigmavirus24 Jan 1, 2017
6888b00
Support for custom indent sizes (tab widths) other than 4
Jun 8, 2013
58e552c
Rebase jansel/master onto PyCQA/master
ArgentFalcon Jun 2, 2016
5db9601
Add test case for variable indent-size
ArgentFalcon Jun 2, 2016
9744188
Clear up wording of cli help page for index_size
ArgentFalcon Jun 2, 2016
00d2a5a
rebase on PyCQA/pycodestyle
choucavalier Jan 18, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
Changelog
=========

2.2.0 (2016-11-14)
------------------

Announcements:

* Added Make target to obtain proper tarball file permissions; #599

Bugs:

* Fixed E305 regression caused by #400; #593

2.1.0 (2016-11-04)
------------------

Announcements:

* Change all references to the pep8 project to say pycodestyle; #530

Changes:

* Report E302 for blank lines before an "async def"; #556
* Update our list of tested and supported Python versions which are 2.6, 2.7,
3.2, 3.3, 3.4 and 3.5 as well as the nightly Python build and PyPy.
* Report E742 and E743 for functions and classes badly named 'l', 'O', or 'I'.
* Report E741 on 'global' and 'nonlocal' statements, as well as prohibited
single-letter variables.
* Deprecated use of `[pep8]` section name in favor of `[pycodestyle]`; #591
* Report E722 when bare except clause is used; #579

Bugs:

* Fix opt_type AssertionError when using Flake8 2.6.2 and pycodestyle; #561
* Require two blank lines after toplevel def, class; #536
* Remove accidentally quadratic computation based on the number of colons. This
will make pycodestyle faster in some cases; #314

2.0.0 (2016-05-31)
------------------
Expand Down
74 changes: 71 additions & 3 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,72 @@
Contributing to ``pycodestyle``
===============================
Contributing to pycodestyle
===========================

Please see the `developer notes <https://pycodestyle.readthedocs.io/en/latest/developer.html>`_
When contributing to pycodestyle, please observe our `Code of Conduct`_.

Step 1: Forking pycodestyle for editing
---------------------------------------

Fork the pycodestyle repository on GitHub. This will add
pycodestyle to your GitHub account. You will push your changes to your
fork and then make pull requests into the official pycodestyle repository.

GitHub has an excellent `guide`_ that has screenshots on how to do this.

Next, clone your fork of the pycodestyle repository to your system for
editing::

$ git clone https://www.github.com/<your_username>/pycodestyle

Now you have a copy of the pycodestyle codebase that is almost ready for
edits. Next we will setup `virtualenv`_ which will help create an isolated
environment to manage dependancies.


Step 2: Use virtualenv when developing
--------------------------------------

`virtualenv`_ is a tool to create isolated python environments.
First, install virtualenv with::

$ pip install virtualenv

Next, ``cd`` to the pycodestyle repository that you cloned earlier and
create, then activate a virtualenv::

$ cd pycodestyle
$ virtualenv pycodestyle-venv
$ source pycodestyle-venv/bin/activate

Now you can install the pycodestyle requirements::

$ pip install -r dev-requirements.txt

To deactivate the virtualenv you can type::

$ deactivate

For more information see `virtualenv`_'s documentation.


Step 3: Run tests
-----------------

Before creating a pull request you should run the tests to make sure that the
changes that have been made haven't caused any regressions in functionality.
To run the tests, the core developer team and Travis-CI use `tox`_::

$ pip install -r dev-requirements.txt
$ tox

All the tests should pass for all available interpreters, with the summary of::

congratulations :)

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`_.

.. _virtualenv: http://docs.python-guide.org/en/latest/dev/virtualenvs/
.. _guide: https://guides.github.com/activities/forking/
.. _tox: https://tox.readthedocs.io/en/latest/
.. _Code of Conduct: http://meta.pycqa.org/en/latest/code-of-conduct.html
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
release:
umask 022 && chmod -R a+rX . && python setup.py sdist bdist_wheel

test :
python pycodestyle.py --testsuite testsuite

Expand Down
34 changes: 23 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
pycodestyle (formerly called pep8) - Python style guide checker
===============================================================

.. image:: https://img.shields.io/travis/PyCQA/pycodestyle.svg
:target: https://travis-ci.org/PyCQA/pycodestyle
:alt: Build status

.. image:: https://readthedocs.org/projects/pycodestyle/badge/?version=latest
:target: https://pycodestyle.readthedocs.io
:alt: Documentation Status

.. image:: https://img.shields.io/pypi/wheel/pycodestyle.svg
:target: https://pypi.python.org/pypi/pycodestyle
:alt: Wheel Status

.. image:: https://badges.gitter.im/PyCQA/pycodestyle.svg
:alt: Join the chat at https://gitter.im/PyCQA/pycodestyle
:target: https://gitter.im/PyCQA/pycodestyle?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge

pycodestyle is a tool to check your Python code against some of the style
conventions in `PEP 8`_.

Expand All @@ -9,8 +25,12 @@ conventions in `PEP 8`_.
.. note::

This package used to be called ``pep8`` but was renamed to ``pycodestyle``
to reduce confusion. Further discussion `here
<https://github.com/PyCQA/pycodestyle/issues/466>`_.
to reduce confusion. Further discussion can be found `in the issue where
Guido requested this
change <https://github.com/PyCQA/pycodestyle/issues/466>`_, or in the
lightning talk at PyCon 2016 by @IanLee1521:
`slides <https://speakerdeck.com/ianlee1521/pep8-vs-pep-8>`_
`video <https://youtu.be/PulzIT8KYLk?t=36m>`_.

Features
--------
Expand All @@ -27,7 +47,7 @@ Features
Installation
------------

You can install, upgrade, uninstall ``pycodestyle.py`` with these commands::
You can install, upgrade, and uninstall ``pycodestyle.py`` with these commands::

$ pip install pycodestyle
$ pip install --upgrade pycodestyle
Expand Down Expand Up @@ -83,14 +103,6 @@ Or you can display how often each error was found::
Links
-----

.. image:: https://api.travis-ci.org/PyCQA/pycodestyle.png?branch=master
:target: https://travis-ci.org/PyCQA/pycodestyle
:alt: Build status

.. image:: https://pypip.in/wheel/pycodestyle/badge.png?branch=master
:target: https://pypi.python.org/pypi/pycodestyle
:alt: Wheel Status

* `Read the documentation <https://pycodestyle.readthedocs.io/>`_

* `Fork me on GitHub <http://github.com/PyCQA/pycodestyle>`_
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tox
16 changes: 13 additions & 3 deletions docs/developer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ 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.4 and PyPy, on `Travis-CI platform
<http://about.travis-ci.org/>`_.
2.6 through 3.5 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 All @@ -27,7 +27,8 @@ Some high-level aims and directions to bear in mind for contributions:

* ``pycodestyle`` is intended to be as fast as possible.
Using the ``ast`` module defeats that purpose.
The `pep8-naming <https://github.com/flintwork/pep8-naming>`_ plugin exists for this sort of functionality.
The `pep8-naming <https://github.com/flintwork/pep8-naming>`_ plugin exists
for this sort of functionality.
* If you want to provide extensibility / plugins,
please see `flake8 <https://gitlab.com/pycqa/flake8>`_ -
``pycodestyle`` doesn't want or need a plugin architecture.
Expand Down Expand Up @@ -103,6 +104,15 @@ 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::

$ pip install -r dev-requirements.txt
$ tox

All the tests should pass for all available interpreters, with the summary of::

congratulations :)

.. _PEP 8: http://www.python.org/dev/peps/pep-0008/
.. _Code of Conduct: http://meta.pycqa.org/en/latest/code-of-conduct.html

Expand Down
34 changes: 24 additions & 10 deletions docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ Quick help is available on the command line::
--count print total number of errors and warnings to standard
error and set exit code to 1 if total is not null
--max-line-length=n set maximum allowed line length (default: 79)
--indent-size=n set how many spaces make up an indent (default: 4)
--hang-closing hang closing bracket instead of matching indentation of
opening bracket's line
--format=format set the error format [default|pylint|<custom>]
Expand All @@ -167,13 +168,14 @@ Quick help is available on the command line::
--benchmark measure processing speed

Configuration:
The project options are read from the [pep8] section of the tox.ini
file or the setup.cfg file located in any parent folder of the path(s)
being processed. Allowed options are: exclude, filename, select,
The project options are read from the [pycodestyle] section of the
tox.ini file or the setup.cfg file located in any parent folder of the
path(s) being processed. Allowed options are: exclude, filename, select,
ignore, max-line-length, hang-closing, count, format, quiet, show-pep8,
show-source, statistics, verbose.

--config=path user config file location (default: ~/.config/pep8)
--config=path user config file location
(default: ~/.config/pycodestyle)


Configuration
Expand All @@ -184,23 +186,23 @@ The behaviour may be configured at two levels, the user and project levels.
At the user level, settings are read from the following locations:

If on Windows:
``~\.pep8``
``~\.pycodestyle``

Otherwise, if the :envvar:`XDG_CONFIG_HOME` environment variable is defined:
``XDG_CONFIG_HOME/pep8``
``XDG_CONFIG_HOME/pycodestyle``

Else if :envvar:`XDG_CONFIG_HOME` is not defined:
``~/.config/pep8``
``~/.config/pycodestyle``

Example::

[pep8]
[pycodestyle]
ignore = E226,E302,E41
max-line-length = 160

At the project level, a ``setup.cfg`` file or a ``tox.ini`` file is read if
present. If none of these files have a ``[pep8]`` section, no project specific
configuration is loaded.
present. If none of these files have a ``[pycodestyle]`` section, no project
specific configuration is loaded.


Error codes
Expand Down Expand Up @@ -321,6 +323,10 @@ This is the current list of error and warning codes:
+------------+----------------------------------------------------------------------+
| E304 | blank lines found after function decorator |
+------------+----------------------------------------------------------------------+
| E305 | expected 2 blank lines after end of function or class |
+------------+----------------------------------------------------------------------+
| E306 | expected 1 blank line before a nested definition |
+------------+----------------------------------------------------------------------+
+------------+----------------------------------------------------------------------+
| **E4** | *Import* |
+------------+----------------------------------------------------------------------+
Expand Down Expand Up @@ -356,8 +362,16 @@ This is the current list of error and warning codes:
+------------+----------------------------------------------------------------------+
| E721 (^) | do not compare types, use 'isinstance()' |
+------------+----------------------------------------------------------------------+
| E722 | do not use bare except, specify exception instead |
+------------+----------------------------------------------------------------------+
| E731 | do not assign a lambda expression, use a def |
+------------+----------------------------------------------------------------------+
| E741 | do not use variables named 'l', 'O', or 'I' |
+------------+----------------------------------------------------------------------+
| E742 | do not define classes named 'l', 'O', or 'I' |
+------------+----------------------------------------------------------------------+
| E743 | do not define functions named 'l', 'O', or 'I' |
+------------+----------------------------------------------------------------------+
+------------+----------------------------------------------------------------------+
| **E9** | *Runtime* |
+------------+----------------------------------------------------------------------+
Expand Down
Loading