[Koha-devel] tt style point

MJ Ray mjr at phonecoop.coop
Mon Sep 19 18:18:02 CEST 2011


Mason James wrote:
> i too, sure would love to get an agreement on a consistent, mechanised formatting style for perl code in Koha
> fyi: Koha's current .perltidyrc was never agreed upon, it was simply submitted and accepted 
> 
> is there anyone that *doesnt* want -pbp 'Perl Best Practices' style formatting as the default??

Probably.  I dislike delegating this decision to an O'Reilly book
and it would change some historic practices, so probably reformat
a lot of code.  I think -pbp is equivalent to:

    -l=78 -i=4 -ci=4 -st -se -vt=2 -cti=0 -pt=1 -bt=1 -sbt=1 -bbt=1 -nsfs -nolq
    -wbb="% + - * / x != == >= <= =~ !~ < > | & = 
          **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x="

but the perltidy man page doesn't say why those are best practices!
They look as arbitrary as the GNU Coding Standards to me and rather
more invasive, but would anyone who has the book like to enlighten us?

The Koha current perltidyrc conflicts with -pbp in that it has -l=178
-ci=2 -bbt=0 -sfs -olq which disagree with the above.

I've linked the perltidyrc from
http://wiki.koha-community.org/wiki/Coding_Guidelines#Perl
which might help more people to notice it.

I think that perltidyrc was submitted in response to bug 2269 by
Andrew Moore at LibLime, apparently based on my suggestions.  I also
suggested -bar -ce which I don't think affects -pbp either way, -vt=2
which agrees, -pt=2 which disagrees and -en=4 which doesn't even seem
to exist!

http://wiki.koha-community.org/wiki/Coding_Guidelines#To_be_decided
also specifies a capitalisation approach, -> for hashrefs and use of
ODLIS terms which I don't think perltidy can enforce.

So, why would it be worth changing the line length limits,
indentation, outdentation, brace-tightness, and semicolon spacing to pbp?

Looking forward to your replies,
-- 
MJ Ray (slef), member of www.software.coop, a for-more-than-profit co-op.
Webmaster, Debian Developer, Past Koha RM, statistician, former lecturer.
In My Opinion Only: see http://mjr.towers.org.uk/email.html
Available for hire for various work through http://www.software.coop/


More information about the Koha-devel mailing list