Re: [PATCH v6] checkpatch: add support to check 'Fixes:' tag format

2020-05-22 Thread Wang YanQing
On Mon, May 04, 2020 at 11:34:31AM -0700, Joe Perches wrote:
> On Mon, 2020-05-04 at 16:20 +0800, Wang YanQing wrote:
> > According to submitting-patches.rst, 'Fixes:' tag has a little
> > stricter condition about the one line summary than normal git
> > commit description:
> > “...
> > Do not split the tag across multiple lines, tags are exempt from
> > the "wrap at 75 columns" rule in order to simplify parsing scripts
> > ...”
> > 
> > And there is no sanity check for 'Fixes:' tag format in checkpatch
> > the same as GIT_COMMIT_ID for git commit description, so let's expand
> > the GIT_COMMIT_ID to add 'Fixes:' tag format check support.
> > 
> > The check supports below formats:
> > Fixes: 54a4f0239f2e ("KVM: MMU: make kvm_mmu_zap_page() return the number 
> > of pages it actually freed")
> > Fixes: 85f7cd3a2aad ("Revert "media: Kconfig: better support hybrid TV 
> > devices"")
> > Fixes: 878520ac45f9 ("ext4: save the error code which triggered...")
> > Fixes: 878520ac45f9 ("ext4: save the error code which triggered")
> > Fixes: 277f27e2f277 ("SUNRPC/cache: Allow garbage collection ... ")
> > 
> > The check doesn't support below formats and it will emit diagnostics info 
> > for them:
> > Fixes: f2c2e717642c ("usb: gadget: add raw-gadget interface"
> > Fixes: 6c73698904aa pinctrl: qcom: Introduce readl/writel accessors
> > Fixes: 3fd6e7d9a146 (ASoC: tas571x: New driver for TI TAS571x power 
> > amplifiers)
> > Fixes: 55697cbb44e4 ("arm64: dts: renesas: r8a779{65,80,90}: Add IPMMU 
> > devices nodes)
> > Fixes: ba35f8588f47 (“ipvlan: Defer multicast / broadcast processing to a 
> > work-queue”)
> > Fixes: cd758a9b57ee "KVM: PPC: Book3S HV: Use __gfn_to_pfn_memslot in HPT 
> > page fault handler"
> > Fixes:  9b1640686470 ("scsi: lpfc: Fix use-after-free mailbox cmd 
> > completion")
> > Fixes: 03f6fc6de919 ('ASoC: rt5682: Add the soundwire support')
> > Fixes: 03404e8ae652("IB/mlx5: Add support to dropless RQ")
> > 
> > Because after GIT_COMMIT_ID supports 'Fixes:' tag format check, it could do
> > the same check as the UNKNOWN_COMMIT_ID, so we don't need UNKNOWN_COMMIT_ID
> > anymore and I decide to delete it.
> > 
> > Note: this patch also fixes double quotation mark issue for normal git
> >   commit description, and now it supports double quotation mark in
> >   title line, for example:
> >   Commit e33e2241e272 ("Revert "cfg80211: Use 5MHz bandwidth by default
> >   when checking usable channels"")
> > 
> > Note: this patch also adds diagnostics info support for normal git commit
> >   description format check.
> 
> Thanks YanQing.
> 
> All of this seems fine, but perhaps checkpatch's output message content
> could be a bit shorter.  I'll give it a think for a while.
> 

Hi! Joe

What are the status of these patches?
"[PATCH v2] checkpatch: fix can't check for too long invalid commit id"
"[PATCH v6] checkpatch: add support to check 'Fixes:' tag format"
"[PATCH v2] checkpatch: allow commit description spans across three lines"

This is a ping message, maybe you have forgot them?

Thanks.




Re: [PATCH v6] checkpatch: add support to check 'Fixes:' tag format

2020-05-04 Thread Joe Perches
On Mon, 2020-05-04 at 16:20 +0800, Wang YanQing wrote:
> According to submitting-patches.rst, 'Fixes:' tag has a little
> stricter condition about the one line summary than normal git
> commit description:
> “...
> Do not split the tag across multiple lines, tags are exempt from
> the "wrap at 75 columns" rule in order to simplify parsing scripts
> ...”
> 
> And there is no sanity check for 'Fixes:' tag format in checkpatch
> the same as GIT_COMMIT_ID for git commit description, so let's expand
> the GIT_COMMIT_ID to add 'Fixes:' tag format check support.
> 
> The check supports below formats:
> Fixes: 54a4f0239f2e ("KVM: MMU: make kvm_mmu_zap_page() return the number of 
> pages it actually freed")
> Fixes: 85f7cd3a2aad ("Revert "media: Kconfig: better support hybrid TV 
> devices"")
> Fixes: 878520ac45f9 ("ext4: save the error code which triggered...")
> Fixes: 878520ac45f9 ("ext4: save the error code which triggered")
> Fixes: 277f27e2f277 ("SUNRPC/cache: Allow garbage collection ... ")
> 
> The check doesn't support below formats and it will emit diagnostics info for 
> them:
> Fixes: f2c2e717642c ("usb: gadget: add raw-gadget interface"
> Fixes: 6c73698904aa pinctrl: qcom: Introduce readl/writel accessors
> Fixes: 3fd6e7d9a146 (ASoC: tas571x: New driver for TI TAS571x power 
> amplifiers)
> Fixes: 55697cbb44e4 ("arm64: dts: renesas: r8a779{65,80,90}: Add IPMMU 
> devices nodes)
> Fixes: ba35f8588f47 (“ipvlan: Defer multicast / broadcast processing to a 
> work-queue”)
> Fixes: cd758a9b57ee "KVM: PPC: Book3S HV: Use __gfn_to_pfn_memslot in HPT 
> page fault handler"
> Fixes:  9b1640686470 ("scsi: lpfc: Fix use-after-free mailbox cmd 
> completion")
> Fixes: 03f6fc6de919 ('ASoC: rt5682: Add the soundwire support')
> Fixes: 03404e8ae652("IB/mlx5: Add support to dropless RQ")
> 
> Because after GIT_COMMIT_ID supports 'Fixes:' tag format check, it could do
> the same check as the UNKNOWN_COMMIT_ID, so we don't need UNKNOWN_COMMIT_ID
> anymore and I decide to delete it.
> 
> Note: this patch also fixes double quotation mark issue for normal git
>   commit description, and now it supports double quotation mark in
>   title line, for example:
>   Commit e33e2241e272 ("Revert "cfg80211: Use 5MHz bandwidth by default
>   when checking usable channels"")
> 
> Note: this patch also adds diagnostics info support for normal git commit
>   description format check.

Thanks YanQing.

All of this seems fine, but perhaps checkpatch's output message content
could be a bit shorter.  I'll give it a think for a while.




Re: [PATCH v6] checkpatch: add support to check 'Fixes:' tag format

2020-05-04 Thread Wang YanQing
On Mon, May 04, 2020 at 11:45:02AM +0200, Markus Elfring wrote:
> 
> >  4: Add support to check and emit sensible diagnostics
> > info for description which spans across more than
> > two lines.
> 
> My software concerns are growing also for the preferred dependency management.
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=0e698dfa282211e414076f9dc7e83c1c288314fd#n138
>

Hi! Markus Elfring

This feature is a side effect of missing right '")' detection, so I think
it is acceptable to add it.

But I agree with you, this patch is a little big, I don't want to add more
code into it.

Joe, what is your opinion? Do you think this version is good enough to merge?

Thanks!


Re: [PATCH v6] checkpatch: add support to check 'Fixes:' tag format

2020-05-04 Thread Markus Elfring
>  v6:
…
>  2: Fix a typo issue, reported by …
>  3: Reword some diagnostics info.

Such small improvements are nice.


>  4: Add support to check and emit sensible diagnostics
> info for description which spans across more than
> two lines.

My software concerns are growing also for the preferred dependency management.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=0e698dfa282211e414076f9dc7e83c1c288314fd#n138


>  5: Avoid the word "acrosses", suggested by …

Another bit of collateral evolution.

But it seems that further suggestions and ideas need more efforts
to get the desired software development attention (I hope for a while).
Will the clarification and integration of possibly remaining open issues
continue in constructive ways?

Regards,
Markus


[PATCH v6] checkpatch: add support to check 'Fixes:' tag format

2020-05-04 Thread Wang YanQing
According to submitting-patches.rst, 'Fixes:' tag has a little
stricter condition about the one line summary than normal git
commit description:
“...
Do not split the tag across multiple lines, tags are exempt from
the "wrap at 75 columns" rule in order to simplify parsing scripts
...”

And there is no sanity check for 'Fixes:' tag format in checkpatch
the same as GIT_COMMIT_ID for git commit description, so let's expand
the GIT_COMMIT_ID to add 'Fixes:' tag format check support.

The check supports below formats:
Fixes: 54a4f0239f2e ("KVM: MMU: make kvm_mmu_zap_page() return the number of 
pages it actually freed")
Fixes: 85f7cd3a2aad ("Revert "media: Kconfig: better support hybrid TV 
devices"")
Fixes: 878520ac45f9 ("ext4: save the error code which triggered...")
Fixes: 878520ac45f9 ("ext4: save the error code which triggered")
Fixes: 277f27e2f277 ("SUNRPC/cache: Allow garbage collection ... ")

The check doesn't support below formats and it will emit diagnostics info for 
them:
Fixes: f2c2e717642c ("usb: gadget: add raw-gadget interface"
Fixes: 6c73698904aa pinctrl: qcom: Introduce readl/writel accessors
Fixes: 3fd6e7d9a146 (ASoC: tas571x: New driver for TI TAS571x power amplifiers)
Fixes: 55697cbb44e4 ("arm64: dts: renesas: r8a779{65,80,90}: Add IPMMU devices 
nodes)
Fixes: ba35f8588f47 (“ipvlan: Defer multicast / broadcast processing to a 
work-queue”)
Fixes: cd758a9b57ee "KVM: PPC: Book3S HV: Use __gfn_to_pfn_memslot in HPT page 
fault handler"
Fixes:  9b1640686470 ("scsi: lpfc: Fix use-after-free mailbox cmd 
completion")
Fixes: 03f6fc6de919 ('ASoC: rt5682: Add the soundwire support')
Fixes: 03404e8ae652("IB/mlx5: Add support to dropless RQ")

Because after GIT_COMMIT_ID supports 'Fixes:' tag format check, it could do
the same check as the UNKNOWN_COMMIT_ID, so we don't need UNKNOWN_COMMIT_ID
anymore and I decide to delete it.

Note: this patch also fixes double quotation mark issue for normal git
  commit description, and now it supports double quotation mark in
  title line, for example:
  Commit e33e2241e272 ("Revert "cfg80211: Use 5MHz bandwidth by default
  when checking usable channels"")

Note: this patch also adds diagnostics info support for normal git commit
  description format check.

Based on original patch by Joe Perches 

Link: 
https://lore.kernel.org/lkml/40bfc40958fca6e2cc9b86101153aa0715fac4f7.ca...@perches.com/
Signed-off-by: Wang YanQing 
---
 v6:
 1: Fix indentation issue.
 2: Fix a typo issue, reported by Markus Elfring.
 3: Reword some diagnostics info.
 4: Add support to check and emit sensible diagnostics
info for description which spans across more than
two lines.
 5: Avoid the word "acrosses", suggested by Markus Elfring.

 v5:
 1: Rebased on '[PATCH v2] checkpatch: fix can't check for too long invalid 
commit id'.
 2: Fix wrong diagnostics info for below non-standard 'Fixes:' formats.
a: Fixes: 03404e8ae652("IB/mlx5: Add support to dropless RQ")
b: Fixes: da97e18458fb: ("perf_event: Add support for LSM and SELinux 
checks")
 3: Reword the diagnostics info for non-standard title format.

 v4:
 1: Add diagnostics info support, suggested by Joe Perches and Markus Elfring.
 2: Delete UNKNOWN_COMMIT_ID and do the check in GIT_COMMIT_ID.

 v3:
 1: Fix a bug in short title line support.

 v2:
 1: Add support for double quotation mark in title line, suggested by Markus 
Elfring.
 2: Add support for short title line with/without ellipsis.
 3: Add supported format examples and unsupported format examples in changelog.
 4: Fix a little wording issue in changelog , suggested by Markus Elfring.

 scripts/checkpatch.pl | 129 ++
 1 file changed, 99 insertions(+), 30 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 9b47584..ef34716 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2818,51 +2818,109 @@ sub process {
$line !~ 
/^\s*(?:Link|Patchwork|http|https|BugLink|base-commit):/i &&
$line !~ /^This reverts commit [0-9a-f]{7,40}/ &&
($line =~ /\bcommit\s+[0-9a-f]{5,}\b/i ||
+$line =~ /\bfixes:\s+[0-9a-f]{5,}\b/i ||
 ($line =~ /(?:\s|^)[0-9a-f]{12,40}(?:[\s"'\(\[]|$)/i &&
- $line !~ /[\<\[][0-9a-f]{12,40}[\>\]]/i &&
- $line !~ /\bfixes:\s*[0-9a-f]{12,40}/i))) {
+ $line !~ /[\<\[][0-9a-f]{12,40}[\>\]]/i))) {
my $init_char = "c";
my $orig_commit = "";
+   my $prefix = "commit";
+   my $prefix_case = "[Cc]ommit";
my $short = 1;
my $long = 0;
my $case = 1;
my $space = 1;
+   my $space2 = 1;
my $hasdesc = 0;
-   my $hasparens = 0;
+   my