<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Developer’s notes — pep8 1.5.7 documentation</title> <link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: './', VERSION: '1.5.7', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <link rel="top" title="pep8 1.5.7 documentation" href="index.html" /> <link rel="prev" title="pep8 API" href="api.html" /> </head> <body> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="api.html" title="pep8 API" accesskey="P">previous</a> |</li> <li><a href="index.html">pep8 1.5.7 documentation</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="developer-s-notes"> <h1>Developer’s notes<a class="headerlink" href="#developer-s-notes" title="Permalink to this headline">¶</a></h1> <div class="section" id="source-code"> <h2>Source code<a class="headerlink" href="#source-code" title="Permalink to this headline">¶</a></h2> <p>The source code is currently <a class="reference external" href="https://github.com/jcrocholl/pep8">available on GitHub</a> under the terms and conditions of the <a class="reference internal" href="index.html#license"><em>Expat license</em></a>. Fork away!</p> <ul class="simple"> <li><a class="reference external" href="https://github.com/jcrocholl/pep8">Source code</a> and <a class="reference external" href="https://github.com/jcrocholl/pep8/issues">issue tracker</a> on GitHub.</li> <li><a class="reference external" href="http://travis-ci.org/jcrocholl/pep8">Continuous tests</a> against Python 2.6 through 3.4 and PyPy, on <a class="reference external" href="http://about.travis-ci.org/">Travis-CI platform</a>.</li> </ul> </div> <div class="section" id="contribute"> <h2>Contribute<a class="headerlink" href="#contribute" title="Permalink to this headline">¶</a></h2> <p>You can add checks to this program by writing plugins. Each plugin is a simple function that is called for each line of source code, either physical or logical.</p> <p>Physical line:</p> <ul class="simple"> <li>Raw line of text from the input file.</li> </ul> <p>Logical line:</p> <ul class="simple"> <li>Multi-line statements converted to a single line.</li> <li>Stripped left and right.</li> <li>Contents of strings replaced with <tt class="docutils literal"><span class="pre">"xxx"</span></tt> of same length.</li> <li>Comments removed.</li> </ul> <p>The check function requests physical or logical lines by the name of the first argument:</p> <div class="highlight-python"><div class="highlight"><pre>def maximum_line_length(physical_line) def extraneous_whitespace(logical_line) def blank_lines(logical_line, blank_lines, indent_level, line_number) </pre></div> </div> <p>The last example above demonstrates how check plugins can request additional information with extra arguments. All attributes of the <a class="reference internal" href="api.html#pep8.Checker" title="pep8.Checker"><tt class="xref py py-class docutils literal"><span class="pre">Checker</span></tt></a> object are available. Some examples:</p> <ul class="simple"> <li><tt class="docutils literal"><span class="pre">lines</span></tt>: a list of the raw lines from the input file</li> <li><tt class="docutils literal"><span class="pre">tokens</span></tt>: the tokens that contribute to this logical line</li> <li><tt class="docutils literal"><span class="pre">line_number</span></tt>: line number in the input file</li> <li><tt class="docutils literal"><span class="pre">total_lines</span></tt>: number of lines in the input file</li> <li><tt class="docutils literal"><span class="pre">blank_lines</span></tt>: blank lines before this one</li> <li><tt class="docutils literal"><span class="pre">indent_char</span></tt>: indentation character in this file (<tt class="docutils literal"><span class="pre">"</span> <span class="pre">"</span></tt> or <tt class="docutils literal"><span class="pre">"\t"</span></tt>)</li> <li><tt class="docutils literal"><span class="pre">indent_level</span></tt>: indentation (with tabs expanded to multiples of 8)</li> <li><tt class="docutils literal"><span class="pre">previous_indent_level</span></tt>: indentation on previous line</li> <li><tt class="docutils literal"><span class="pre">previous_logical</span></tt>: previous logical line</li> </ul> <p>The docstring of each check function shall be the relevant part of text from <a class="reference external" href="http://www.python.org/dev/peps/pep-0008/">PEP 8</a>. It is printed if the user enables <tt class="docutils literal"><span class="pre">--show-pep8</span></tt>. Several docstrings contain examples directly from the <a class="reference external" href="http://www.python.org/dev/peps/pep-0008/">PEP 8</a> document.</p> <div class="highlight-python"><div class="highlight"><pre>Okay: spam(ham[1], {eggs: 2}) E201: spam( ham[1], {eggs: 2}) </pre></div> </div> <p>These examples are verified automatically when pep8.py is run with the <tt class="docutils literal"><span class="pre">--doctest</span></tt> option. You can add examples for your own check functions. The format is simple: <tt class="docutils literal"><span class="pre">"Okay"</span></tt> or error/warning code followed by colon and space, the rest of the line is example source code. If you put <tt class="docutils literal"><span class="pre">'r'</span></tt> before the docstring, you can use <tt class="docutils literal"><span class="pre">\n</span></tt> for newline and <tt class="docutils literal"><span class="pre">\t</span></tt> for tab.</p> <p>Then be sure to pass the tests:</p> <div class="highlight-python"><div class="highlight"><pre>$ python pep8.py --testsuite testsuite $ python pep8.py --doctest $ python pep8.py --verbose pep8.py </pre></div> </div> </div> <div class="section" id="changes"> <h2>Changes<a class="headerlink" href="#changes" title="Permalink to this headline">¶</a></h2> <div class="section" id="id2"> <h3>1.5.7 (2014-05-29)<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3> <p>Bug fixes:</p> <ul class="simple"> <li>Skip the traceback on “Broken pipe” signal. (Issue #275)</li> <li>Do not exit when an option in <tt class="docutils literal"><span class="pre">setup.cfg</span></tt> or <tt class="docutils literal"><span class="pre">tox.ini</span></tt> is not recognized.</li> <li>Check the last line even if it does not end with a newline. (Issue #286)</li> <li>Always open files in universal newlines mode in Python 2. (Issue #288)</li> </ul> </div> <div class="section" id="id3"> <h3>1.5.6 (2014-04-14)<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3> <p>Bug fixes:</p> <ul class="simple"> <li>Check the last line even if it has no end-of-line. (Issue #273)</li> </ul> </div> <div class="section" id="id4"> <h3>1.5.5 (2014-04-10)<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3> <p>Bug fixes:</p> <ul class="simple"> <li>Fix regression with E22 checks and inline comments. (Issue #271)</li> </ul> </div> <div class="section" id="id5"> <h3>1.5.4 (2014-04-07)<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3> <p>Bug fixes:</p> <ul class="simple"> <li>Fix negative offset with E303 before a multi-line docstring. (Issue #269)</li> </ul> </div> <div class="section" id="id6"> <h3>1.5.3 (2014-04-04)<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3> <p>Bug fixes:</p> <ul class="simple"> <li>Fix wrong offset computation when error is on the last char of a physical line. (Issue #268)</li> </ul> </div> <div class="section" id="id7"> <h3>1.5.2 (2014-04-04)<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h3> <p>Changes:</p> <ul class="simple"> <li>Distribute a universal wheel file.</li> </ul> <p>Bug fixes:</p> <ul class="simple"> <li>Report correct line number for E303 with comments. (Issue #60)</li> <li>Do not allow newline after parameter equal. (Issue #252)</li> <li>Fix line number reported for multi-line strings. (Issue #220)</li> <li>Fix false positive E121/E126 with multi-line strings. (Issue #265)</li> <li>Fix E501 not detected in comments with Python 2.5.</li> <li>Fix caret position with <tt class="docutils literal"><span class="pre">--show-source</span></tt> when line contains tabs.</li> </ul> </div> <div class="section" id="id8"> <h3>1.5.1 (2014-03-27)<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3> <p>Bug fixes:</p> <ul class="simple"> <li>Fix a crash with E125 on multi-line strings. (Issue #263)</li> </ul> </div> <div class="section" id="id9"> <h3>1.5 (2014-03-26)<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3> <p>Changes:</p> <ul class="simple"> <li>Report E129 instead of E125 for visually indented line with same indent as next logical line. (Issue #126)</li> <li>Report E265 for space before block comment. (Issue #190)</li> <li>Report E713 and E714 when operators <tt class="docutils literal"><span class="pre">not</span> <span class="pre">in</span></tt> and <tt class="docutils literal"><span class="pre">is</span> <span class="pre">not</span></tt> are recommended. (Issue #236)</li> <li>Allow long lines in multiline strings and comments if they cannot be wrapped. (Issue #224).</li> <li>Optionally disable physical line checks inside multiline strings, using <tt class="docutils literal"><span class="pre">#</span> <span class="pre">noqa</span></tt>. (Issue #242)</li> <li>Change text for E121 to report “continuation line under-indented for hanging indent” instead of indentation not being a multiple of 4.</li> <li>Report E131 instead of E121 / E126 if the hanging indent is not consistent within the same continuation block. It helps when error E121 or E126 is in the <tt class="docutils literal"><span class="pre">ignore</span></tt> list.</li> <li>Report E126 instead of E121 when the continuation line is hanging with extra indentation, even if indentation is not a multiple of 4.</li> </ul> <p>Bug fixes:</p> <ul class="simple"> <li>Allow the checkers to report errors on empty files. (Issue #240)</li> <li>Fix ignoring too many checks when <tt class="docutils literal"><span class="pre">--select</span></tt> is used with codes declared in a flake8 extension. (Issue #216)</li> <li>Fix regression with multiple brackets. (Issue #214)</li> <li>Fix <tt class="docutils literal"><span class="pre">StyleGuide</span></tt> to parse the local configuration if the keyword argument <tt class="docutils literal"><span class="pre">paths</span></tt> is specified. (Issue #246)</li> <li>Fix a false positive E124 for hanging indent. (Issue #254)</li> <li>Fix a false positive E126 with embedded colon. (Issue #144)</li> <li>Fix a false positive E126 when indenting with tabs. (Issue #204)</li> <li>Fix behaviour when <tt class="docutils literal"><span class="pre">exclude</span></tt> is in the configuration file and the current directory is not the project directory. (Issue #247)</li> <li>The logical checks can return <tt class="docutils literal"><span class="pre">None</span></tt> instead of an empty iterator. (Issue #250)</li> <li>Do not report multiple E101 if only the first indentation starts with a tab. (Issue #237)</li> <li>Fix a rare false positive W602. (Issue #34)</li> </ul> </div> <div class="section" id="id10"> <h3>1.4.6 (2013-07-02)<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3> <p>Changes:</p> <ul class="simple"> <li>Honor <tt class="docutils literal"><span class="pre">#</span> <span class="pre">noqa</span></tt> for errors E711 and E712. (Issue #180)</li> <li>When both a <tt class="docutils literal"><span class="pre">tox.ini</span></tt> and a <tt class="docutils literal"><span class="pre">setup.cfg</span></tt> are present in the project directory, merge their contents. The <tt class="docutils literal"><span class="pre">tox.ini</span></tt> file takes precedence (same as before). (Issue #182)</li> <li>Give priority to <tt class="docutils literal"><span class="pre">--select</span></tt> over <tt class="docutils literal"><span class="pre">--ignore</span></tt>. (Issue #188)</li> <li>Compare full path when excluding a file. (Issue #186)</li> <li>New option <tt class="docutils literal"><span class="pre">--hang-closing</span></tt> to switch to the alternative style of closing bracket indentation for hanging indent. Add error E133 for closing bracket which is missing indentation. (Issue #103)</li> <li>Accept both styles of closing bracket indentation for hanging indent. Do not report error E123 in the default configuration. (Issue #103)</li> </ul> <p>Bug fixes:</p> <ul class="simple"> <li>Do not crash when running AST checks and the document contains null bytes. (Issue #184)</li> <li>Correctly report other E12 errors when E123 is ignored. (Issue #103)</li> <li>Fix false positive E261/E262 when the file contains a BOM. (Issue #193)</li> <li>Fix E701, E702 and E703 not detected sometimes. (Issue #196)</li> <li>Fix E122 not detected in some cases. (Issue #201 and #208)</li> <li>Fix false positive E121 with multiple brackets. (Issue #203)</li> </ul> </div> <div class="section" id="id11"> <h3>1.4.5 (2013-03-06)<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>When no path is specified, do not try to read from stdin. The feature was added in 1.4.3, but it is not supported on Windows. Use <tt class="docutils literal"><span class="pre">-</span></tt> filename argument to read from stdin. This usage is supported since 1.3.4. (Issue #170)</li> <li>Do not require <tt class="docutils literal"><span class="pre">setuptools</span></tt> in setup.py. It works around an issue with <tt class="docutils literal"><span class="pre">pip</span></tt> and Python 3. (Issue #172)</li> <li>Add <tt class="docutils literal"><span class="pre">__pycache__</span></tt> to the ignore list.</li> <li>Change misleading message for E251. (Issue #171)</li> <li>Do not report false E302 when the source file has a coding cookie or a comment on the first line. (Issue #174)</li> <li>Reorganize the tests and add tests for the API and for the command line usage and options. (Issues #161 and #162)</li> <li>Ignore all checks which are not explicitly selected when <tt class="docutils literal"><span class="pre">select</span></tt> is passed to the <tt class="docutils literal"><span class="pre">StyleGuide</span></tt> constructor.</li> </ul> </div> <div class="section" id="id12"> <h3>1.4.4 (2013-02-24)<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Report E227 or E228 instead of E225 for whitespace around bitwise, shift or modulo operators. (Issue #166)</li> <li>Change the message for E226 to make clear that it is about arithmetic operators.</li> <li>Fix a false positive E128 for continuation line indentation with tabs.</li> <li>Fix regression with the <tt class="docutils literal"><span class="pre">--diff</span></tt> option. (Issue #169)</li> <li>Fix the <tt class="docutils literal"><span class="pre">TestReport</span></tt> class to print the unexpected warnings and errors.</li> </ul> </div> <div class="section" id="id13"> <h3>1.4.3 (2013-02-22)<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Hide the <tt class="docutils literal"><span class="pre">--doctest</span></tt> and <tt class="docutils literal"><span class="pre">--testsuite</span></tt> options when installed.</li> <li>Fix crash with AST checkers when the syntax is invalid. (Issue #160)</li> <li>Read from standard input if no path is specified.</li> <li>Initiate a graceful shutdown on <tt class="docutils literal"><span class="pre">Control+C</span></tt>.</li> <li>Allow to change the <tt class="docutils literal"><span class="pre">checker_class</span></tt> for the <tt class="docutils literal"><span class="pre">StyleGuide</span></tt>.</li> </ul> </div> <div class="section" id="id14"> <h3>1.4.2 (2013-02-10)<a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Support AST checkers provided by third-party applications.</li> <li>Register new checkers with <tt class="docutils literal"><span class="pre">register_check(func_or_cls,</span> <span class="pre">codes)</span></tt>.</li> <li>Allow to construct a <tt class="docutils literal"><span class="pre">StyleGuide</span></tt> with a custom parser.</li> <li>Accept visual indentation without parenthesis after the <tt class="docutils literal"><span class="pre">if</span></tt> statement. (Issue #151)</li> <li>Fix UnboundLocalError when using <tt class="docutils literal"><span class="pre">#</span> <span class="pre">noqa</span></tt> with continued lines. (Issue #158)</li> <li>Re-order the lines for the <tt class="docutils literal"><span class="pre">StandardReport</span></tt>.</li> <li>Expand tabs when checking E12 continuation lines. (Issue #155)</li> <li>Refactor the testing class <tt class="docutils literal"><span class="pre">TestReport</span></tt> and the specific test functions into a separate test module.</li> </ul> </div> <div class="section" id="id15"> <h3>1.4.1 (2013-01-18)<a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Allow sphinx.ext.autodoc syntax for comments. (Issue #110)</li> <li>Report E703 instead of E702 for the trailing semicolon. (Issue #117)</li> <li>Honor <tt class="docutils literal"><span class="pre">#</span> <span class="pre">noqa</span></tt> in addition to <tt class="docutils literal"><span class="pre">#</span> <span class="pre">nopep8</span></tt>. (Issue #149)</li> <li>Expose the <tt class="docutils literal"><span class="pre">OptionParser</span></tt> factory for better extensibility.</li> </ul> </div> <div class="section" id="id16"> <h3>1.4 (2012-12-22)<a class="headerlink" href="#id16" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Report E226 instead of E225 for optional whitespace around common operators (<tt class="docutils literal"><span class="pre">*</span></tt>, <tt class="docutils literal"><span class="pre">**</span></tt>, <tt class="docutils literal"><span class="pre">/</span></tt>, <tt class="docutils literal"><span class="pre">+</span></tt> and <tt class="docutils literal"><span class="pre">-</span></tt>). This new error code is ignored in the default configuration because PEP 8 recommends to “use your own judgement”. (Issue #96)</li> <li>Lines with a <tt class="docutils literal"><span class="pre">#</span> <span class="pre">nopep8</span></tt> at the end will not issue errors on line length E501 or continuation line indentation E12*. (Issue #27)</li> <li>Fix AssertionError when the source file contains an invalid line ending <tt class="docutils literal"><span class="pre">"\r\r\n"</span></tt>. (Issue #119)</li> <li>Read the <tt class="docutils literal"><span class="pre">[pep8]</span></tt> section of <tt class="docutils literal"><span class="pre">tox.ini</span></tt> or <tt class="docutils literal"><span class="pre">setup.cfg</span></tt> if present. (Issue #93 and #141)</li> <li>Add the Sphinx-based documentation, and publish it on <a class="reference external" href="http://pep8.readthedocs.org/">http://pep8.readthedocs.org/</a>. (Issue #105)</li> </ul> </div> <div class="section" id="id17"> <h3>1.3.4 (2012-12-18)<a class="headerlink" href="#id17" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Fix false positive E124 and E128 with comments. (Issue #100)</li> <li>Fix error on stdin when running with bpython. (Issue #101)</li> <li>Fix false positive E401. (Issue #104)</li> <li>Report E231 for nested dictionary in list. (Issue #142)</li> <li>Catch E271 at the beginning of the line. (Issue #133)</li> <li>Fix false positive E126 for multi-line comments. (Issue #138)</li> <li>Fix false positive E221 when operator is preceded by a comma. (Issue #135)</li> <li>Fix <tt class="docutils literal"><span class="pre">--diff</span></tt> failing on one-line hunk. (Issue #137)</li> <li>Fix the <tt class="docutils literal"><span class="pre">--exclude</span></tt> switch for directory paths. (Issue #111)</li> <li>Use <tt class="docutils literal"><span class="pre">-</span></tt> filename to read from standard input. (Issue #128)</li> </ul> </div> <div class="section" id="id18"> <h3>1.3.3 (2012-06-27)<a class="headerlink" href="#id18" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Fix regression with continuation line checker. (Issue #98)</li> </ul> </div> <div class="section" id="id19"> <h3>1.3.2 (2012-06-26)<a class="headerlink" href="#id19" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Revert to the previous behaviour for <tt class="docutils literal"><span class="pre">--show-pep8</span></tt>: do not imply <tt class="docutils literal"><span class="pre">--first</span></tt>. (Issue #89)</li> <li>Add E902 for IO errors. (Issue #87)</li> <li>Fix false positive for E121, and missed E124. (Issue #92)</li> <li>Set a sensible default path for config file on Windows. (Issue #95)</li> <li>Allow <tt class="docutils literal"><span class="pre">verbose</span></tt> in the configuration file. (Issue #91)</li> <li>Show the enforced <tt class="docutils literal"><span class="pre">max-line-length</span></tt> in the error message. (Issue #86)</li> </ul> </div> <div class="section" id="id20"> <h3>1.3.1 (2012-06-18)<a class="headerlink" href="#id20" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Explain which configuration options are expected. Accept and recommend the options names with hyphen instead of underscore. (Issue #82)</li> <li>Do not read the user configuration when used as a module (except if <tt class="docutils literal"><span class="pre">config_file=True</span></tt> is passed to the <tt class="docutils literal"><span class="pre">StyleGuide</span></tt> constructor).</li> <li>Fix wrong or missing cases for the E12 series.</li> <li>Fix cases where E122 was missed. (Issue #81)</li> </ul> </div> <div class="section" id="id21"> <h3>1.3 (2012-06-15)<a class="headerlink" href="#id21" title="Permalink to this headline">¶</a></h3> <div class="admonition warning"> <p class="first admonition-title">Warning</p> <p class="last">The internal API is backwards incompatible.</p> </div> <ul class="simple"> <li>Remove global configuration and refactor the library around a <tt class="docutils literal"><span class="pre">StyleGuide</span></tt> class; add the ability to configure various reporters. (Issue #35 and #66)</li> <li>Read user configuration from <tt class="docutils literal"><span class="pre">~/.config/pep8</span></tt> and local configuration from <tt class="docutils literal"><span class="pre">./.pep8</span></tt>. (Issue #22)</li> <li>Fix E502 for backslash embedded in multi-line string. (Issue #68)</li> <li>Fix E225 for Python 3 iterable unpacking (PEP 3132). (Issue #72)</li> <li>Enable the new checkers from the E12 series in the default configuration.</li> <li>Suggest less error-prone alternatives for E712 errors.</li> <li>Rewrite checkers to run faster (E22, E251, E27).</li> <li>Fixed a crash when parsed code is invalid (too many closing brackets).</li> <li>Fix E127 and E128 for continuation line indentation. (Issue #74)</li> <li>New option <tt class="docutils literal"><span class="pre">--format</span></tt> to customize the error format. (Issue #23)</li> <li>New option <tt class="docutils literal"><span class="pre">--diff</span></tt> to check only modified code. The unified diff is read from STDIN. Example: <tt class="docutils literal"><span class="pre">hg</span> <span class="pre">diff</span> <span class="pre">|</span> <span class="pre">pep8</span> <span class="pre">--diff</span></tt> (Issue #39)</li> <li>Correctly report the count of failures and set the exit code to 1 when the <tt class="docutils literal"><span class="pre">--doctest</span></tt> or the <tt class="docutils literal"><span class="pre">--testsuite</span></tt> fails.</li> <li>Correctly detect the encoding in Python 3. (Issue #69)</li> <li>Drop support for Python 2.3, 2.4 and 3.0. (Issue #78)</li> </ul> </div> <div class="section" id="id22"> <h3>1.2 (2012-06-01)<a class="headerlink" href="#id22" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Add E121 through E128 for continuation line indentation. These checks are disabled by default. If you want to force all checks, use switch <tt class="docutils literal"><span class="pre">--select=E,W</span></tt>. Patch by Sam Vilain. (Issue #64)</li> <li>Add E721 for direct type comparisons. (Issue #47)</li> <li>Add E711 and E712 for comparisons to singletons. (Issue #46)</li> <li>Fix spurious E225 and E701 for function annotations. (Issue #29)</li> <li>Add E502 for explicit line join between brackets.</li> <li>Fix E901 when printing source with <tt class="docutils literal"><span class="pre">--show-source</span></tt>.</li> <li>Report all errors for each checker, instead of reporting only the first occurrence for each line.</li> <li>Option <tt class="docutils literal"><span class="pre">--show-pep8</span></tt> implies <tt class="docutils literal"><span class="pre">--first</span></tt>.</li> </ul> </div> <div class="section" id="id23"> <h3>1.1 (2012-05-24)<a class="headerlink" href="#id23" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Add E901 for syntax errors. (Issues #63 and #30)</li> <li>Add E271, E272, E273 and E274 for extraneous whitespace around keywords. (Issue #57)</li> <li>Add <tt class="docutils literal"><span class="pre">tox.ini</span></tt> configuration file for tests. (Issue #61)</li> <li>Add <tt class="docutils literal"><span class="pre">.travis.yml</span></tt> configuration file for continuous integration. (Issue #62)</li> </ul> </div> <div class="section" id="id24"> <h3>1.0.1 (2012-04-06)<a class="headerlink" href="#id24" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Fix inconsistent version numbers.</li> </ul> </div> <div class="section" id="id25"> <h3>1.0 (2012-04-04)<a class="headerlink" href="#id25" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Fix W602 <tt class="docutils literal"><span class="pre">raise</span></tt> to handle multi-char names. (Issue #53)</li> </ul> </div> <div class="section" id="id26"> <h3>0.7.0 (2012-03-26)<a class="headerlink" href="#id26" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Now <tt class="docutils literal"><span class="pre">--first</span></tt> prints only the first occurrence of each error. The <tt class="docutils literal"><span class="pre">--repeat</span></tt> flag becomes obsolete because it is the default behaviour. (Issue #6)</li> <li>Allow to specify <tt class="docutils literal"><span class="pre">--max-line-length</span></tt>. (Issue #36)</li> <li>Make the shebang more flexible. (Issue #26)</li> <li>Add testsuite to the bundle. (Issue #25)</li> <li>Fixes for Jython. (Issue #49)</li> <li>Add PyPI classifiers. (Issue #43)</li> <li>Fix the <tt class="docutils literal"><span class="pre">--exclude</span></tt> option. (Issue #48)</li> <li>Fix W602, accept <tt class="docutils literal"><span class="pre">raise</span></tt> with 3 arguments. (Issue #34)</li> <li>Correctly select all tests if <tt class="docutils literal"><span class="pre">DEFAULT_IGNORE</span> <span class="pre">==</span> <span class="pre">''</span></tt>.</li> </ul> </div> <div class="section" id="id27"> <h3>0.6.1 (2010-10-03)<a class="headerlink" href="#id27" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Fix inconsistent version numbers. (Issue #21)</li> </ul> </div> <div class="section" id="id28"> <h3>0.6.0 (2010-09-19)<a class="headerlink" href="#id28" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Test suite reorganized and enhanced in order to check more failures with fewer test files. Read the <tt class="docutils literal"><span class="pre">run_tests</span></tt> docstring for details about the syntax.</li> <li>Fix E225: accept <tt class="docutils literal"><span class="pre">print</span> <span class="pre">>>sys.stderr,</span> <span class="pre">"..."</span></tt> syntax.</li> <li>Fix E501 for lines containing multibyte encoded characters. (Issue #7)</li> <li>Fix E221, E222, E223, E224 not detected in some cases. (Issue #16)</li> <li>Fix E211 to reject <tt class="docutils literal"><span class="pre">v</span> <span class="pre">=</span> <span class="pre">dic['a']</span> <span class="pre">['b']</span></tt>. (Issue #17)</li> <li>Exit code is always 1 if any error or warning is found. (Issue #10)</li> <li><tt class="docutils literal"><span class="pre">--ignore</span></tt> checks are now really ignored, especially in conjunction with <tt class="docutils literal"><span class="pre">--count</span></tt>. (Issue #8)</li> <li>Blank lines with spaces yield W293 instead of W291: some developers want to ignore this warning and indent the blank lines to paste their code easily in the Python interpreter.</li> <li>Fix E301: do not require a blank line before an indented block. (Issue #14)</li> <li>Fix E203 to accept NumPy slice notation <tt class="docutils literal"><span class="pre">a[0,</span> <span class="pre">:]</span></tt>. (Issue #13)</li> <li>Performance improvements.</li> <li>Fix decoding and checking non-UTF8 files in Python 3.</li> <li>Fix E225: reject <tt class="docutils literal"><span class="pre">True+False</span></tt> when running on Python 3.</li> <li>Fix an exception when the line starts with an operator.</li> <li>Allow a new line before closing <tt class="docutils literal"><span class="pre">)</span></tt>, <tt class="docutils literal"><span class="pre">}</span></tt> or <tt class="docutils literal"><span class="pre">]</span></tt>. (Issue #5)</li> </ul> </div> <div class="section" id="id29"> <h3>0.5.0 (2010-02-17)<a class="headerlink" href="#id29" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Changed the <tt class="docutils literal"><span class="pre">--count</span></tt> switch to print to sys.stderr and set exit code to 1 if any error or warning is found.</li> <li>E241 and E242 are removed from the standard checks. If you want to include these checks, use switch <tt class="docutils literal"><span class="pre">--select=E,W</span></tt>. (Issue #4)</li> <li>Blank line is not mandatory before the first class method or nested function definition, even if there’s a docstring. (Issue #1)</li> <li>Add the switch <tt class="docutils literal"><span class="pre">--version</span></tt>.</li> <li>Fix decoding errors with Python 3. (Issue #13 <a class="footnote-reference" href="#id38" id="id30">[1]</a>)</li> <li>Add <tt class="docutils literal"><span class="pre">--select</span></tt> option which is mirror of <tt class="docutils literal"><span class="pre">--ignore</span></tt>.</li> <li>Add checks E261 and E262 for spaces before inline comments.</li> <li>New check W604 warns about deprecated usage of backticks.</li> <li>New check W603 warns about the deprecated operator <tt class="docutils literal"><span class="pre"><></span></tt>.</li> <li>Performance improvement, due to rewriting of E225.</li> <li>E225 now accepts:<ul> <li>no whitespace after unary operator or similar. (Issue #9 <a class="footnote-reference" href="#id38" id="id31">[1]</a>)</li> <li>lambda function with argument unpacking or keyword defaults.</li> </ul> </li> <li>Reserve “2 blank lines” for module-level logical blocks. (E303)</li> <li>Allow multi-line comments. (E302, issue #10 <a class="footnote-reference" href="#id38" id="id32">[1]</a>)</li> </ul> </div> <div class="section" id="id33"> <h3>0.4.2 (2009-10-22)<a class="headerlink" href="#id33" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Decorators on classes and class methods are OK now.</li> </ul> </div> <div class="section" id="id34"> <h3>0.4 (2009-10-20)<a class="headerlink" href="#id34" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Support for all versions of Python from 2.3 to 3.1.</li> <li>New and greatly expanded self tests.</li> <li>Added <tt class="docutils literal"><span class="pre">--count</span></tt> option to print the total number of errors and warnings.</li> <li>Further improvements to the handling of comments and blank lines. (Issue #1 <a class="footnote-reference" href="#id38" id="id35">[1]</a> and others changes.)</li> <li>Check all py files in directory when passed a directory (Issue #2 <a class="footnote-reference" href="#id38" id="id36">[1]</a>). This also prevents an exception when traversing directories with non <tt class="docutils literal"><span class="pre">*.py</span></tt> files.</li> <li>E231 should allow commas to be followed by <tt class="docutils literal"><span class="pre">)</span></tt>. (Issue #3 <a class="footnote-reference" href="#id38" id="id37">[1]</a>)</li> <li>Spaces are no longer required around the equals sign for keyword arguments or default parameter values.</li> </ul> <table class="docutils footnote" frame="void" id="id38" rules="none"> <colgroup><col class="label" /><col /></colgroup> <tbody valign="top"> <tr><td class="label">[1]</td><td><em>(<a class="fn-backref" href="#id30">1</a>, <a class="fn-backref" href="#id31">2</a>, <a class="fn-backref" href="#id32">3</a>, <a class="fn-backref" href="#id35">4</a>, <a class="fn-backref" href="#id36">5</a>, <a class="fn-backref" href="#id37">6</a>)</em> These issues refer to the <a class="reference external" href="http://github.com/cburroughs/pep8.py/issues">previous issue tracker</a>.</td></tr> </tbody> </table> </div> <div class="section" id="id40"> <h3>0.3.1 (2009-09-14)<a class="headerlink" href="#id40" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Fixes for comments: do not count them when checking for blank lines between items.</li> <li>Added setup.py for pypi upload and easy_installability.</li> </ul> </div> <div class="section" id="id41"> <h3>0.2 (2007-10-16)<a class="headerlink" href="#id41" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Loads of fixes and improvements.</li> </ul> </div> <div class="section" id="id42"> <h3>0.1 (2006-10-01)<a class="headerlink" href="#id42" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>First release.</li> </ul> </div> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Developer’s notes</a><ul> <li><a class="reference internal" href="#source-code">Source code</a></li> <li><a class="reference internal" href="#contribute">Contribute</a></li> <li><a class="reference internal" href="#changes">Changes</a><ul> <li><a class="reference internal" href="#id2">1.5.7 (2014-05-29)</a></li> <li><a class="reference internal" href="#id3">1.5.6 (2014-04-14)</a></li> <li><a class="reference internal" href="#id4">1.5.5 (2014-04-10)</a></li> <li><a class="reference internal" href="#id5">1.5.4 (2014-04-07)</a></li> <li><a class="reference internal" href="#id6">1.5.3 (2014-04-04)</a></li> <li><a class="reference internal" href="#id7">1.5.2 (2014-04-04)</a></li> <li><a class="reference internal" href="#id8">1.5.1 (2014-03-27)</a></li> <li><a class="reference internal" href="#id9">1.5 (2014-03-26)</a></li> <li><a class="reference internal" href="#id10">1.4.6 (2013-07-02)</a></li> <li><a class="reference internal" href="#id11">1.4.5 (2013-03-06)</a></li> <li><a class="reference internal" href="#id12">1.4.4 (2013-02-24)</a></li> <li><a class="reference internal" href="#id13">1.4.3 (2013-02-22)</a></li> <li><a class="reference internal" href="#id14">1.4.2 (2013-02-10)</a></li> <li><a class="reference internal" href="#id15">1.4.1 (2013-01-18)</a></li> <li><a class="reference internal" href="#id16">1.4 (2012-12-22)</a></li> <li><a class="reference internal" href="#id17">1.3.4 (2012-12-18)</a></li> <li><a class="reference internal" href="#id18">1.3.3 (2012-06-27)</a></li> <li><a class="reference internal" href="#id19">1.3.2 (2012-06-26)</a></li> <li><a class="reference internal" href="#id20">1.3.1 (2012-06-18)</a></li> <li><a class="reference internal" href="#id21">1.3 (2012-06-15)</a></li> <li><a class="reference internal" href="#id22">1.2 (2012-06-01)</a></li> <li><a class="reference internal" href="#id23">1.1 (2012-05-24)</a></li> <li><a class="reference internal" href="#id24">1.0.1 (2012-04-06)</a></li> <li><a class="reference internal" href="#id25">1.0 (2012-04-04)</a></li> <li><a class="reference internal" href="#id26">0.7.0 (2012-03-26)</a></li> <li><a class="reference internal" href="#id27">0.6.1 (2010-10-03)</a></li> <li><a class="reference internal" href="#id28">0.6.0 (2010-09-19)</a></li> <li><a class="reference internal" href="#id29">0.5.0 (2010-02-17)</a></li> <li><a class="reference internal" href="#id33">0.4.2 (2009-10-22)</a></li> <li><a class="reference internal" href="#id34">0.4 (2009-10-20)</a></li> <li><a class="reference internal" href="#id40">0.3.1 (2009-09-14)</a></li> <li><a class="reference internal" href="#id41">0.2 (2007-10-16)</a></li> <li><a class="reference internal" href="#id42">0.1 (2006-10-01)</a></li> </ul> </li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="api.html" title="previous chapter">pep8 API</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="_sources/developer.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="api.html" title="pep8 API" >previous</a> |</li> <li><a href="index.html">pep8 1.5.7 documentation</a> »</li> </ul> </div> <div class="footer"> © Copyright 2012-2013, Florent Xicluna. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3. </div> </body> </html>