from
Brian Troutwine <goofyheadedpunk at gmail dot com>
to
Benjamin Niemann <pink at odahoda dot de>
subject
Re: [Python-projects] Possibility of using pylint to automatically
reformt code?
date
> Quick googling suggests http://www.polystyle.com/, you might give it a try.2006/04/03 09:57
Quick googlings prove, in this case, to be ineffective. I found
polystyle right away, but it's a Windows only application and closed.
Either invalidate it's use.
> The purpose of this convention is to make the code readable in 80-column
> display, e.g. terminal windows. On such narrow displays the code gets
> wrapped on a mostly random positions making it hard to read.
I understand the convention, both from an aesthetics standpoint and
from mere practicality. This is why I asked.
> An 'automated code wrapper' could not do much more - break the line a
> whitespace close to column 80, which does not take the program logic into
> account. So there's not much advantage over long lines.
I would say that a code beautifier that does not take program logic
into account is pretty much useless to begin with. So, since you're
positing one that does not, I agree. I, however, assumed that a
brain-dead filter which merely busted up lines would be of little use
to no one, and so did not feel it necessary to state this.
> Should you ever have to read and understand the code, break lines
> manually in a way that makes sense and the code more readable.
"About a week ago I came into a poorly formatted medium sized project,
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."
Given that it is now my project to maintain and develop I will most
definitely have to read and understand the code. The difficulty of
doing this manually is that the task is simply monumental. Making
repairs to the codebase, while obviously not completely automatable,
would certainly be much more pleasent if I could have the help of a
program. I would not expect such a thing to be perfect, of course, but
comparing a program getting things 75% right in 45 seconds or me
getting it 98% in a month I'd choose the program.
> ...but I've never heard of such a thing.
Thank you. That's what I was asking.
--
BLT
_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects
