hhatto/autopep8 — pull request #31 by samv (2012-06-30 00:55:52+00:00)
Title: Hey, here's that E12 fixer.  This one just does initial indent fixing.

New continuation line errors were added to pep8.py; here is a first
attempt to fix them. A new class, Wrapper, is added which will later
have alternate strategies for resolving indention situations. It has
a magic function which "knows" what pep8.py's E12 checker will accept,
by duplicating its tokenizing loop and emitting allowable indentation
offsets for each line.

Naturally, E12 errors are related to long line errors; for instance,
indenting a line to the requested level will often push the line past
the right margin, tripping E501. Especially when visual indenting is
being used. The forward plan is to refactor the newly added
_shorten_line() into Wrapper, and to add further line folding
strategies (such as "prefer hanging indent", useful for long lines
with parenthesized parts). This should allow for attempting multiple
strategies for folding a line, with the "best" one selected