No such thing as a small change | |
PerlMonks |
Re^2: Why does perltidy mess up whitespace before inline comments and equals?by will_ (Scribe) |
on Oct 20, 2014 at 13:30 UTC ( [id://1104437]=note: print w/replies, xml ) | Need Help?? |
Rolf, I would expect those lines not to change at all. Eily, thanks -msc pointed me in the right direction. After some more experimenting, I've found that this code: gets changed to this: ...which is definitely better in that case. But even if only the last line had a comment and I use -msc=1: ...it still pushes the comment way out to the right to align with some non-existent other comments. That's not necessary.
Setting -ols/-nolc don't seem to have any effect on this. And now I've found what I was looking for: This sets "static side comments", and sets the identifier for those to the usual # character docs: http://perltidy.sourceforge.net/perltidy.html#static_side_comments This lines up the equals but leaves the comments alone. The only time the equals doesn't get lined up is if that would make the line longer than the -l setting, which is fair enough.
In Section
Seekers of Perl Wisdom
|
|