[Koha-devel] tt style point

Mason James mtj at kohaaloha.com
Tue Sep 20 13:40:52 CEST 2011


reply inline

On 2011-09-20, at 8:17 PM, LAURENT Henri-Damien wrote:

> Le 20/09/2011 04:33, Mason James a écrit :
>> 
>> i'm not suggesting existing code will be rejected if its not formatted to the new perltidy style, thats too painful!!
>> 
>> i simply suggest we start the process by agreeing on a standard, and go from there...
>> 
> it is always the same question : who will decide

we can decide now the koha-devel mailing-list, or as a topic for the next Koha IRC meeting


> and who will process
> the files ?

not sure on that bit yet :p , lets agree on a Perl style standard first, then decide who/how/when later


>> the current perltidyrc file *is* just an idle file, because it was never agreed upon...
>> 
>> lets agree on a formatting style, and make the spec official. then it wont be just an idle file :)
> When ? some things has already been committed. And things donot get
> improved.


when should we agree on a formatting style,? how about now...

>> 
>> 
>> i'm strongly against having old code 'perltidy-fied' in huge commits, because i know the problems that causes with tools like 'git-blame', etc
> I am not.
> git blame may be useful, but code readability is a much serious issue.
> I think that some decision should be not only discussed but also taken,
> announced and applied.

ah, ok 
that would be the next thing to discuss, after we all voted on a Perl formatting style :)

>> 
>> so i suggest we slowly and gently correct small blocks of existing code - as we work on it
>> and the formatting in new Koha releases will start to become more consistent
> How can you enforce PBP or any formatting on part of a file ?

its easy using vim!, and surely possible for all other respectable editors


> If previous file indentation is broken, you will just add broken things.

nope, perltidy corrects the indentation perfectly, without any syntax errors


> If there is some magic I don't know please tell me.

yes, there is some magic :)

i added this to my .vimrc file, now F4 tidys a selected block of text :)
fyi: i use this method many times a day

----------------------------------------                                                              
map <F4>   <Esc>:%! perltidy<CR>                                                
----------------------------------------                                                              

described here...
http://www.modernperlbooks.com/mt/2009/10/from-novice-to-adept-cleaning-up-bad-code.html

i very rarely run perltidy on a whole Koha file, 
instead i run it *carefully* on small blocks of messy historical Koha code as i see them


>> i personally don't mind *what* that standard is... i just want an agreed upon standard
>> but hey... --PBP get my vote by a mile!
>> 
> I don't know what ranty mean.

"To speak agressivly about somthing. or to take your own tangent about a subject and talk for a long time in a passionate manner" :)

http://www.urbandictionary.com/define.php?term=rant


> But don't be mistaken, all I want is a change for better. The fact is
> that ppl are working on the same code ignoring what other ppl are doing.
> And with the need to revamp more and more things for security,
> sustainability and performance issues. I think that it should be shared,
> discussed, stated, worked in groups and done.

yes... but thats a separate issue to what Perl formatting style to use for Koha

so remember, there's a few who/when/how issues to discuss here... 
but can we at least agree on a Perl formatting style, for a start

-PBP++ ;)


cheers, Mason


More information about the Koha-devel mailing list