[yt-dev] PEP8

Matthew Turk matthewturk at gmail.com
Thu Feb 2 11:13:41 PST 2012


As a followup, Stephen submitted a pull request to update a bunch of
PEP8 stuff he did by hand.  He and I chatted in IRC before I accepted
it, and he has told me he's going to refrain from any further pull
requests until we bring in both the geometry_handling and
volume_refactor branches.

Changing intra-line whitespace is a nice easy way of causing merge
conflicts that are super annoying, so having fewer branches when we do
this is a good idea.

On Wed, Feb 1, 2012 at 12:20 PM, Matthew Turk <matthewturk at gmail.com> wrote:
> 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