[Koha-devel] Tab stops in source code
Mason James
mason.loves.sushi at gmail.com
Fri Nov 14 01:48:49 CET 2008
On 2008/11/14, at 2:50 AM, Paul POULAIN wrote:
> Rick Welykochy a écrit :
>> Mason James wrote:
>>
>>> but i think we might have to allow either tabs or spaces from
>>> developers -
>>> (thats perltidys behavior too afaik)
>>
>> Why would anyone indent with spaces?
check this link for hearty examples of 'tabs versus spaces'
discussion, enjoy ;)
http://www.perlmonks.org/?node_id=576936
for me, the above discussion eventually has a obvious conclusion,
which is...
tabs have the possibility to be displayed in a whole bunch of
different ways
depending on what os/shell/editor/termtype/xterm/whatever
combination you are using
and spaces dont,..
i think spaces continue to be the best 'lowest-common-denominator'
choice for a big open-source project like koha,
>
> we spoke of that a loonnnggg time ago.
> I don't remember the details, but i remember that I've changed my
> way of
> indenting from tab to spaces.
> And since then all commits are done with spaces, I think the tab ones
> are oldies that have never be fixed.
>
>>> the important thing is a consistent indent length of 4, i think.
>>
>> Hooray for that!
>
> yep.
>
>> And what about the templates? They are often mind-bending to edit,
>> and I've
>> seen no tools to assist in comprehending their structure.
>
> agreed...
yep
i had a look about 2.5 years ago at 'htmltidy' to help format the
templates, but i hit a bit of problem
the problem was that htmltidy doesnt understand the <!-- TMPL_*** -->
tags, so it cant properly format the file
the best it can do is ignore the tags, and not give a parse-error :/
so, it still has it uses for tiding a messy template file, but the
indentation needs to be done manually after the parse
but still, better than nothing...
there was a work-in-progress mod for HTML::Template support in htmltidy,
but i cant spot it in the current cvs tree ( i may have missed it )
http://tidy.cvs.sourceforge.net/viewvc/tidy/tidy/
has there been any better html-type pretty-printer projects since,
people???
or is htmltidy still the closest thing we have for this task
it would be a very big win if we could find a tool to help
standardise the templatefiles format,
and tidy up the messy existing files too
its been ages since i last looked at htmltidy, so its worth another
look,
even just to check on the (non)progress of the HTMPL::Template
handling code
FYI: heres the link http://tidy.sourceforge.net/
Mason.
More information about the Koha-devel
mailing list