Re: [Koha-devel] code formatting (was: [Koha-patches] [PATCH] Bug 2176: adding SMS::Send to list of dependencies)
Hi MJ - On Mon, Jun 23, 2008 at 4:18 AM, MJ Ray <mjr@phonecoop.coop> wrote:
Why does this patch covertly reindent everything?
I didn't intend for it to be covert. [...]
OK. Please try to mention these things in comments. It'd be a bit of a pain to cherry-pick a patch described as "adding SMS::Send ..." and have the dep's rewritten without warning.
Alright. If it helps you out, I'll add a comment about this to my growing commit template. I have started to try to bundle refactoring patches into a separate patch before functionality. I'll try to be a little more liberal on deciding what kinds of whitespace changes to pull out into a separate patch.
I'd really like to be able to use perltidy to make the code that I edit and contribute more readable. Is there a particular indentation style that you think would be good to use on code that I change in Koha? I couldn't find much about this on the wiki.
If my notes from 1.9 are accurate, we used to use perltidy -bar -ce -pt=2 -vt=2 -en=4 which is almost what is in the perlstyle manual, except cuddled elses. However, it's not been enforced much and "more readable" depends on what you're using to read it...
Super, a step towards consensus! I've opened up bug 2269 to add a perltidyrc file with these options and will work to follow it. <http://bugs.koha.org/cgi-bin/bugzilla/show_bug.cgi?id=2269>
The wiki really isn't in good shape and I find it too much of a pain to edit. Searching the mailing list and IRC is usually more useful. Should we create a HACKING file (which is what I think GNU software calls the file) with the above sort of info in it?
I agree that the wiki is tough to edit. I'm struggling to grow used to it, too. But, I think it could be a valuable resource, so I'm personally hesitant to abandon it. I was actually considering adding a "contributors checklist" or something similar on the wiki today. I think a HACKING file would be a great contribution, too. Perhaps you could also include some information about how to make your code translatable, too. That's an area that I'm struggling to find documentation on. Thanks! -Andy _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-devel
I'd really like to be able to use perltidy to make the code that I edit and contribute more readable. Is there a particular indentation style that you think would be good to use on code that I change in Koha? I couldn't find much about this on the wiki.
If my notes from 1.9 are accurate, we used to use perltidy -bar -ce -pt=2 -vt=2 -en=4 which is almost what is in the perlstyle manual, except cuddled elses. However, it's not been enforced much and "more readable" depends on what you're using to read it...
Super, a step towards consensus!
I've opened up bug 2269 to add a perltidyrc file with these options and will work to follow it. <http://bugs.koha.org/cgi-bin/bugzilla/show_bug.cgi?id=2269>
Heya Andy Just a quickie from me on this great topic i have recently found 2 nice vim macros that allow you to select a block of text and perltidy it, and perltidy the whole file too (the following example has these 2 macros bound to keys f4, and f5) stick this in your ~/vimrc file, and feel good ;) " Enable Perltidy processing map <F4> <Esc>:%! perltidy<CR> map <F5> <Esc>:'<,'>! perltidy<CR> cheers, Mason. _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-devel
On Fri, Jun 27, 2008 at 8:48 AM, Mason James <mason.loves.sushi@gmail.com> wrote:
i have recently found 2 nice vim macros that allow you to select a block of text and perltidy it, and perltidy the whole file too
Thanks, Mason. And for those of us on the Dark Side, here are instructions on getting perltidy set up in emacs: http://www.emacswiki.org/cgi-bin/wiki/CPerlMode Now, you can "M-x perltidy-region" Hope it helps! -Andy _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-devel
participants (2)
-
Andrew Moore -
Mason James