Re: [PATCH v7] checkpatch: warn for non-standard fixes tag style

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2022-09-14 at 12:02 +0200, Niklas Söderlund wrote:
> Add a warning for fixes tags that does not follow community conventions.
[]
> * Changes since v6
> - Update first check to make sure that there is a likely SHA1 of some
>   minimum length after the fixes line.

https://lore.kernel.org/lkml/2febb7893346b6234983453de7c037536e479bfc.camel@xxxxxxxxxxx/

The goal here should be to identify a line that looks like a commit
reference.

So find lines that starts with 'fixes' and have a SHA1 commit id as
broadly as reasonable.

Did you run the grep pattern and look at the results?

One grep pattern to verify the non canonical fixes format that
are mistakenly used is:

$ git log --since=5-years-ago --no-merges --grep='^\s*fixes' -i --format=email -P | \
  grep -P -i '^\s*fixes' | \
  grep -P -v '^Fixes: [0-9a-f]{12,12}\s*\(".*")'

[]

There are many different styles.
Parenthesea are sometimes not used.

> +			if ($line =~ /(\s*fixes:?)\s+([0-9a-f]{5,})\s+($balanced_parens)/i) {

How about some pattern like

	/fixes\s*:?\s*(?:commit:?\s*)?[0-9a-f]{5,}/i

or maybe even more broadly:

	/fixes\b.*\b[0-9a-f]{5,}\b/i




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux