[yt-dev] PEP8

Matthew Turk matthewturk at gmail.com
Wed Feb 1 09:20:56 PST 2012


Here's a diff of the entire code base run through autopep8:

http://yt-project.org/files/pep8.diff

On Wed, Feb 1, 2012 at 12:15 PM, Matthew Turk <matthewturk at gmail.com> wrote:
> Hi Stephen,
>
> On Wed, Feb 1, 2012 at 12:04 PM, Stephen Skory <s at skory.us> wrote:
>> For what it's worth, I played around with the autopep8 thing I linked
>> to before, and after applying it "python setup.py install" works
>> (modulo a few source files autopep8 couldn't handle for some reason).
>> Looking through the output, it fixed a few things like comment and
>> operator spacing, but it didn't fix things like too-long lines, even
>> when it is pretty obvious how to do that (like in a list or function
>> prototype with many items separated by commas).
>
> Looking at the source, looks like you have to define transformation functions:
>
> https://github.com/hhatto/autopep8/blob/master/autopep8.py#L156
>
> Error 501 is the line-too-long, and it's not defined.  (-v supplies this info.)
>
> Also, looks like autopep8 is written by the same person as pyprof2html.
>
>>
>> I haven't run any tests to see if any logic was broken.
>>
>> I agree with Matt that we'd probably have to do this by hand. I
>> propose that we at least try to run the pep8 checker on any file we
>> are about to commit a change to before committing, and fix the errors.
>> Doing it this way would take a long time to do the whole code base,
>> clearly, but there's no reason to make the problem worse before we
>> decide to do the whole thing.
>
> This is definitely possible.  It's almost always a bad idea to propose
> a technical "solution" to a sociological problem, but we could supply
> optional pep8 hg hooks for adding new files.
>
> -Matt
>
>>
>>
>> --
>> Stephen Skory
>> s at skory.us
>> http://stephenskory.com/
>> 510.621.3687 (google voice)
>> _______________________________________________
>> yt-dev mailing list
>> yt-dev at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org



More information about the yt-dev mailing list