Re: [patch v4] checkpatch: Signature format verification
From: Joe Perches
Date: Fri May 27 2011 - 15:33:50 EST
On Sat, 2011-05-28 at 00:47 +0530, anish singh wrote:
> On Sat, May 28, 2011 at 12:38 AM, Joe Perches <joe@xxxxxxxxxxx> wrote:
> On Sat, 2011-05-28 at 00:28 +0530, Manish Kumar Singh wrote:
> > For the 3rd time, please use this form:
> > if ($line =~ /^(\s*)($ValidSignatures)(\s*)(.*)$/i) {
> > and if you really want email format validation,
> > use a separate function.
> []
> > Problem with your way of doing is if anyone misses space
> between
> > "sign" & name,
> > the regular expression
> (/^(\s*)($ValidSignatures)(\s*)(.*)$/i )
> > doesn't match
> That's incorrect. Try it.
Anish, do you have a response to this?
> I have replaced b/w with "between".
> And as Manish rightly exlained this patch is not meant for
> email validation.
Yet it does incorrectly anyway to nominally skip
name and find <.*>. That's the problem.
Look again at the patterns:
+ if ($line =~ /^\s*$sign(.*)/i) {
+ if ($1 !~ /^\s+([a-zA-Z\s\"\.\-\'\,]*.*)/i) {
+ WARN("Space required after $sign\n" .
+ $herecurr);
+ }
and
+ if ($1 !~ /([\sa-zA-Z\"\.\-\'\,]*)\s<.*>/i) {
+ WARN("Space required b/w Full Name & Mail-id:\n" .
+ $herecurr);
+ }
> I would like to know if anything else is missing?
Correctness.
Keep at it, it'll eventually be good to go.
cheers, Joe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/