Comment 2 for bug 1247664

Revision history for this message
brianclements (brianclements) wrote : Re: [Bug 1247664] Re: Pythoscope should follow PEP8 layout guidelines for generated files

Actually, you can even see both examples from that sample code on the front
page there. PEP8 (http://www.python.org/dev/peps/pep-0008/#blank-lines)
states for top level functions and classes, there should be 2 blank lines
in between them. In your sample code on the page there, you only have 1.

Likewise, regarding in-line comments, PEP8 (
http://www.python.org/dev/peps/pep-0008/#inline-comments) states there
should be at least 2 spaces separating the code and the comment, here you
only have one.

So modifying your example code, showing the differences in brackets, here
is the corrections:

import unittest
[2nd newline]class TestOldPython(unittest.TestCase):
    def test___init__(self):
        # old_python = OldPython(age)
        assert False []# TODO: implement your test here

    def test_hiss(self):
        # old_python = OldPython(age)
        # self.assertEqual(expected, old_python.hiss())
        assert False []# TODO: implement your test here
 if __name__ == '__main__':
    unittest.main()

I'll admit this is very nit-picky, but if it's being auto-generated, might
as well do it right. Besides, my VIM yells at me if there are any syntax
issues, so that gets old when I have dozens of functions/classes.

Brian Clements
<email address hidden>
http://brianclements.net <http://www.brianclements.net>

On Fri, Nov 8, 2013 at 2:29 AM, Michal Kwiatkowski <email address hidden> wrote:

> Can you give more details, what code are you running pythoscope on?
>
> If you run the example from the main page (http://pythoscope.org/) you
> won't get any of those you mentioned.
>
> ** Changed in: pythoscope
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1247664
>
> Title:
> Pythoscope should follow PEP8 layout guidelines for generated files
>
> Status in Pythoscope, the unit test generator:
> Incomplete
>
> Bug description:
> For those of us with automatic file checkers and the like, having to
> clean up and reformat many many functions in the automatically
> generated test files that fail to meet the PEP8 guidelines seems
> unnecessary. I'm specifically referring to:
>
> 1) 2 blank lines in before top level functions and classes, and imports
> and the rest of the file
> 2) 2 blank spaces before in-line comments
>
> There might be others but so far this is all I've found.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/pythoscope/+bug/1247664/+subscriptions
>