Koha Test Wiki MW Canasta on Koha Portainer

Test major Koha Wiki changes or bug fixes here without fear of breaking the production wiki.

For the current Koha Wiki, visit https://wiki.koha-community.org .

Perltidy

From Koha Test Wiki MW Canasta on Koha Portainer
Jump to navigation Jump to search

The offical perltidy style for perl code in Koha is the perltidy 'default' or 'larry-wall' style. (There was a customised perltidy style for Koha - which was not official or enforced)

$ perltidy ./Koha.pm

you can force the default style (by overriding your ~/.perltidyrc file) using the -nopro or --noprofile option, like this...

$ perltidy -npro ./Koha.pm
$ perltidy --noprofile ./Koha.pm


The current best practice regarding historical Koha code, is to perltidy *only* the specific code block that you are modifying...and no more! (um.. unless its really really fugly :p)

In other words, please don't perltidy entire files, or send patches that contain perltidy changes to code *other* than the code-block being modified


We are currently taking a gently/slowly approach - as the Koha codebase transitions to the new perltidy style

Some info on using vim to perltidy selected code blocks is here


- TODO - add perltidy intergration examples for other editors

The tutorial on the perltidy homepage has a section on using perltidy from within editors on parts of a file.