<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-AU link="#0563C1" vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>Hi Tomas,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I saw you, Katrin, and Jonathan writing in #koha about perltidy. When I’ve tried previously to perltidy in ktd using the “:Tidy” command, it seemed to change the style to something incompatible with <a href="https://wiki.koha-community.org/wiki/Coding_Guidelines">https://wiki.koha-community.org/wiki/Coding_Guidelines</a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>If I type “vi Koha.pm”, then “:echo $MYVIMRC”, it tells me I’m using the /root/.vimrc file. I’m not overwriting that, so it’s the default file that ships with ktd.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I don’t have a good example off the top of my head though. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’ve just tried perltidying debian/scripts/koha-log4perl from <a href="https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32791">https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32791</a>. There are things that look weird to me but after reviewing the coding guidelines, maybe I’ve been wrong all this time.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>For example:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>-                my $snippet = get_snippet({<o:p></o:p></p><p class=MsoNormal>-                    instance => $instance,<o:p></o:p></p><p class=MsoNormal>-                    component => $component,<o:p></o:p></p><p class=MsoNormal>-                });<o:p></o:p></p><p class=MsoNormal>-                if ($snippet){<o:p></o:p></p><p class=MsoNormal>+                my $snippet = get_snippet(<o:p></o:p></p><p class=MsoNormal>+                    {<o:p></o:p></p><p class=MsoNormal>+                        instance  => $instance,<o:p></o:p></p><p class=MsoNormal>+                        component => $component,<o:p></o:p></p><p class=MsoNormal>+                    }<o:p></o:p></p><p class=MsoNormal>+                );<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I always thought we preferred to keep the brackets on the same line (like in all the JS examples on the wiki). <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>It looks like perltidy sometimes mangles the whitespace for comments as well. I’d correctly indented a comment and then perltidy stripped all the whitespace except for 2 leading spaces. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>That all said… overall it probably does look better, so maybe the out of the box perltidy is good enough, and if the same perltidy file is applied across the board I suppose it doesn’t matter…<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>David Cook<o:p></o:p></p><p class=MsoNormal>Senior Software Engineer<o:p></o:p></p><p class=MsoNormal>Prosentient Systems<o:p></o:p></p><p class=MsoNormal>Suite 7.03<o:p></o:p></p><p class=MsoNormal>6a Glen St<o:p></o:p></p><p class=MsoNormal>Milsons Point NSW 2061<o:p></o:p></p><p class=MsoNormal>Australia<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Office: 02 9212 0899<o:p></o:p></p><p class=MsoNormal>Online: 02 8005 0595<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>