perltidy
Benton, Kevin
kevin.benton at amd.com
Tue Aug 1 23:59:30 UTC 2006
I'm wondering how others in this list feel about changing our entrance criteria for new patches to include that the submitting developer should run perltidy on the code prior to submitting it. What do others think? I currently run it with...
perltidy -npro -syn -nce -i=4 -l=78 -lp -cti=1 -bar -sbl -pt=1 -sbt=1 -bbt=1 -nsfs -olc -nolq -sil=0 -nola -nokw -ndsm -aws -dws -skp -nsfp -ntqw -ibc -hsc -csc -csct=40 -csce=1 -cscw -fs -nbl -nsbl -vt=1 -vtc=0 -nsot -nsct -wbb "% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x=" -boc -cab=1 -bol -bok -bot -w filename
Yes, it's a huge command line, but that's easily fixed by creating a .perltidyrc (note the leading .).
If nothing else, it would help us look a bit more closely at our formatting and deviate less from certain standards. This method would also automatically end comments at the end of blocks when the ending was "far" away from the opening, but would not overwrite comments at the end of a block. Far (in this case) is defined as 6 lines or more away from the opening.
By no means do I consider this to be perfect, however, I think it's a great step in the right direction in helping us to get a lot of consistency out of our code formatting and it emphasizes the vast majority of what Perl Best Practices (Conway, 2005) talks about.
---
Kevin Benton
Perl/Bugzilla Developer/Administrator, Perforce SCM Administrator
AMD - ECSD Software Validation and Tools
The opinions stated in this communication do not necessarily reflect the view of Advanced Micro Devices and have not been reviewed by management. This communication may contain sensitive and/or confidential and/or proprietary information. Distribution of such information is strictly prohibited without prior consent of Advanced Micro Devices. This communication is for the intended recipient(s) only. If you have received this communication in error, please notify the sender, then destroy any remaining copies of this communication.
More information about the developers
mailing list