Re: [PATCH] add a trivial patch style checker

Jan Engelhardt
2007-05-29T20:27:24Z

On May 29 2007 10:05, Andy Whitcroft wrote:
>
>>> + if($line=~/^\s*[A-Za-z\d_]+:/ and !($line=~/^\s*default:/)){
>>> + print "Gotos should not be indented\n";
>>> + print "$herecurr";
>>> + $clean = 0;
>>> + }
>>
>> emacs generates one space label in front of a goto label. I wouldn't
>> outlaw this.
>
>Yep, we also now allow one space something to do with diff -p not
>getting confused...

Not only diff and emacs. At least joe (joe.sf.net) is another editor
whose %y tag or so also takes lines with

no space at the front and properly paired parens,braces,etc.

as key lines for %y. Since usually, functions are the only thing at
the beginning of a line, this works well. That's why labels should
be allowed to be indented by one.

Jan
--