"bzr version-info --python" does not give pep-8 compliant output

Bug #701898 reported by Soren Hansen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Undecided
Soren Hansen

Bug Description

$ bzr version-info --python > version_info.py ; pep8 --show-pep8 --show-source version_info.py
version_info.py:20:1: E303 too many blank lines (3)
if __name__ == '__main__':
^
    Separate top-level function and class definitions with two blank lines.

    Method definitions inside a class are separated by a single blank line.

    Extra blank lines may be used (sparingly) to separate groups of related
    functions. Blank lines may be omitted between a bunch of related
    one-liners (e.g. a set of dummy implementations).

    Use blank lines in functions, sparingly, to indicate logical sections.

    Okay: def a():\n pass\n\n\ndef b():\n pass
    Okay: def a():\n pass\n\n\n# Foo\n# Bar\n\ndef b():\n pass

    E301: class Foo:\n b = 0\n def bar():\n pass
    E302: def a():\n pass\n\ndef b(n):\n pass
    E303: def a():\n pass\n\n\n\ndef b(n):\n pass
    E303: def a():\n\n\n\n pass
    E304: @decorator\n\ndef a():\n pass

Related branches

Soren Hansen (soren)
Changed in bzr:
status: New → In Progress
assignee: nobody → Soren Hansen (soren)
Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 2.3b5
Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 701898] [NEW] "bzr version-info --python" does not give pep-8 compliant output

As a follow on, it might be nice to make bzr's test_source run pep8
checks if the tools to do so are available. That would be better than
recreating some of them by hand.

--
Martin

Vincent Ladeuil (vila)
Changed in bzr:
status: In Progress → Fix Released
Revision history for this message
Soren Hansen (soren) wrote :

Ah, conditionally using pep8 is a good idea. I wanted to use pep8 to begin with, but didn't want to add a dependency on it.

Revision history for this message
Soren Hansen (soren) wrote :

I just took a stab at this, but pep8.py seems to not be designed for this sort of use. At all.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 701898] Re: "bzr version-info --python" does not give pep-8 compliant output

On 19 January 2011 18:28, Soren Hansen <email address hidden> wrote:
> I just took a stab at this, but pep8.py seems to not be designed for
> this sort of use. At all.

It would be fine if you run it as a subprocess, if it can't be used inprocess.

--
Martin

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.