from
Brian Troutwine <goofyheadedpunk at gmail dot com>
to
Python-Projects <python-projects at lists dot logilab dot org>
subject
[Python-projects] Possibility of using pylint to automatically
reformt code?
date
About a week ago I came into a poorly formatted medium sized project,2006/04/02 16:30
somewhere on the order of 60,000 lines of code. The formatting is
really sporadic--some source files have indents of 2, 4, or 8 spaces
and lines of 60, 75, or 80 chars--and while pylint correctly points
out where the files need to be changed to come into conformance with
the style guidelines there is simply too much code to reformat all of
that by hand.
So, I began looking around the internet for python beautifiers. The
closest thing I found was Guido's pindent, which lives in
Tools/scripts/ of the python source tree, but it relies on end of
block comments, can't change the length of lines, and has some other
unwelcome restrictions. Given that pindent is the only thing I've
found it looks now like it's time to either roll my own, or beg
someone else to roll one.
To that end I've got a question: How difficult would it be to use
pylint as the backend to a source code re-formatter, assuming that I
want the re-formatter to re-format as closely to the python style
guide as possible? I've looked through the docs and pylint looks to be
pretty inclusive, but with a little finagling I suppose I could get it
would work. Would that be worth my time though? Has something like
this already been done?
--
BLT
_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects
