Skip to contentSkip to conversation

checkpatch: add fix option for COMMIT_LOG_LONG_LINE

PATCH In review Aditya Srivastava 2 participants 7 messages Nov 7, 2020 – Nov 8, 2020 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 checkpatch: add fix option for COMMIT_LOG_LONG_LINE

Currently, when a line exceeds 75 characters in a commit message, checkpatch.pl gives a warning corresponding to the same.

E.g., running checkpatch on commit a1af2afbd244 ("drm/nouveau/volt:Fix for some cards having 0 maximum voltage") we get this warning:

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)

Some, mostly Fermi, vbioses appear to have zero max voltage. That causes Nouveau to not parse voltage entries, thus users not being able to set higher clocks.

Provide a fix by consuming first 70 chars of the corresponding line, then stop at the next whitespace, and substitute it with the consumed chars and a newline char.

---
 scripts/checkpatch.pl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +5 -2
index 5a1096a4e220..ee665208ef02 100755
@@ -2881,8 +2881,11 @@ sub process {
 		      $line =~ /^\s*(?:Fixes:|Link:)/i ||
 					# A Fixes: or Link: line
 		      $commit_log_possible_stack_dump)) {
-			WARN("COMMIT_LOG_LONG_LINE",
-			     "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr);
+			if (WARN("COMMIT_LOG_LONG_LINE",
+				 "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr) &&
+			    $fix) {
+				$fixed[$fixlinenr] =~ s/(.{70}[^\s]*)\s+/$1\n/g;
+			}
 			$commit_log_long_line = 1;
 		}
 
Signature · 6 lines
2.17.1

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
author
#1 lore raw
Quoted 29 lines · Aditya Srivastava

Currently, when a line exceeds 75 characters in a commit message, checkpatch.pl gives a warning corresponding to the same.

E.g., running checkpatch on commit a1af2afbd244 ("drm/nouveau/volt:Fix for some cards having 0 maximum voltage") we get this warning:

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)

Some, mostly Fermi, vbioses appear to have zero max voltage. That causes Nouveau to not parse voltage entries, thus users not being able to set higher clocks.

Provide a fix by consuming first 70 chars of the corresponding line, then stop at the next whitespace, and substitute it with the consumed chars and a newline char.

---
 scripts/checkpatch.pl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +0 -0
index 5a1096a4e220..ee665208ef02 100755
@@ -2881,8 +2881,11 @@ sub process {
 		      $line =~ /^\s*(?:Fixes:|Link:)/i ||
 					# A Fixes: or Link: line
 		      $commit_log_possible_stack_dump)) {

scripts/checkpatch.pl sub process { · line 2891

Quoted 10 lines
scripts/checkpatch.pl +5 -2
-			WARN("COMMIT_LOG_LONG_LINE",
-			     "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr);
+			if (WARN("COMMIT_LOG_LONG_LINE",
+				 "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr) &&
+			    $fix) {
+				$fixed[$fixlinenr] =~ s/(.{70}[^\s]*)\s+/$1\n/g;
+			}
 			$commit_log_long_line = 1;
 		}
 

Changes made in v2:
- Changing newline at whitespace instead of abrupt termination
- The special line cases such as 'Link', 'Fixes' or code addition lines, etc. seem to be already excluded from this warning in the if-block statements above the warning statement.

Thanks
Aditya
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#2 lore raw
Quoted 34 lines · Aditya
Quoted 10 lines · Aditya Srivastava

Currently, when a line exceeds 75 characters in a commit message, checkpatch.pl gives a warning corresponding to the same.

E.g., running checkpatch on commit a1af2afbd244 ("drm/nouveau/volt:Fix for some cards having 0 maximum voltage") we get this warning:

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)

Some, mostly Fermi, vbioses appear to have zero max voltage. That causes

Nouveau to not parse voltage entries, thus users not being able to set higher clocks.

Quoted 15 lines

Provide a fix by consuming first 70 chars of the corresponding line, then stop at the next whitespace, and substitute it with the consumed chars and a newline char.

---
 scripts/checkpatch.pl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +0 -0
index 5a1096a4e220..ee665208ef02 100755

scripts/checkpatch.pl sub process { · line 2885

Quoted 5 lines
scripts/checkpatch.pl +0 -2
@@ -2881,8 +2881,11 @@ sub process {
                    $line =~ /^\s*(?:Fixes:|Link:)/i ||
                                      # A Fixes: or Link: line
                    $commit_log_possible_stack_dump)) {
-                     WARN("COMMIT_LOG_LONG_LINE",
-                          "Possible unwrapped commit description

(prefer a maximum 75 chars per line)\n" . $herecurr);

Quoted 12 lines

scripts/checkpatch.pl sub process { · line 2885

Quoted 2 lines
scripts/checkpatch.pl +2 -0
+                     if (WARN("COMMIT_LOG_LONG_LINE",
+                              "Possible unwrapped commit description

(prefer a maximum 75 chars per line)\n" . $herecurr) &&

scripts/checkpatch.pl sub process { · line 2887

Quoted 2 lines
scripts/checkpatch.pl +2 -0
+                         $fix) {
+                             $fixed[$fixlinenr] =~

s/(.{70}[^\s]*)\s+/$1\n/g;

Quoted 5 lines
scripts/checkpatch.pl +1 -0
+                     }
                      $commit_log_long_line = 1;
              }
 

Why do you not implement a proper word wrap function?

A single commit tells us very little if this rule in checkpatch.pl really is a good rule or not. A proper evaluation of typical cases of long commit lines would help much more to improve this rule.

Lukas

Quoted 10 lines

Changes made in v2:
- Changing newline at whitespace instead of abrupt termination
- The special line cases such as 'Link', 'Fixes' or code addition lines, etc. seem to be already excluded from this warning in the if-block statements above the warning statement.

Thanks
Aditya

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

author
#3 lore raw
Quoted 42 lines · Lukas Bulwahn
Quoted 40 lines · Aditya
Quoted 10 lines · Aditya Srivastava

Currently, when a line exceeds 75 characters in a commit message, checkpatch.pl gives a warning corresponding to the same.

E.g., running checkpatch on commit a1af2afbd244 ("drm/nouveau/volt:Fix for some cards having 0 maximum voltage") we get this warning:

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)

Some, mostly Fermi, vbioses appear to have zero max voltage. That causes

Nouveau to not parse voltage entries, thus users not being able to set higher clocks.

Quoted 15 lines

Provide a fix by consuming first 70 chars of the corresponding line, then stop at the next whitespace, and substitute it with the consumed chars and a newline char.

---
 scripts/checkpatch.pl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +0 -0
index 5a1096a4e220..ee665208ef02 100755

scripts/checkpatch.pl sub process { · line 2885

Quoted 5 lines
scripts/checkpatch.pl +0 -2
@@ -2881,8 +2881,11 @@ sub process {
                    $line =~ /^\s*(?:Fixes:|Link:)/i ||
                                      # A Fixes: or Link: line
                    $commit_log_possible_stack_dump)) {
-                     WARN("COMMIT_LOG_LONG_LINE",
-                          "Possible unwrapped commit description

(prefer a maximum 75 chars per line)\n" . $herecurr);

scripts/checkpatch.pl sub process { · line 2885

Quoted 2 lines
scripts/checkpatch.pl +2 -0
+                     if (WARN("COMMIT_LOG_LONG_LINE",
+                              "Possible unwrapped commit description

(prefer a maximum 75 chars per line)\n" . $herecurr) &&

scripts/checkpatch.pl sub process { · line 2887

Quoted 2 lines
scripts/checkpatch.pl +2 -0
+                         $fix) {
+                             $fixed[$fixlinenr] =~

s/(.{70}[^\s]*)\s+/$1\n/g;

Quoted 9 lines
Quoted 6 lines

scripts/checkpatch.pl sub process { · line 2891

Quoted 5 lines
scripts/checkpatch.pl +1 -0
+                     }
                      $commit_log_long_line = 1;
              }
 

Why do you not implement a proper word wrap function?

Actually, I had searched on the web regarding it before implementation. Here I have implemented text wrap only and regex is the best way I could find of implementing it. Also the same was advised at stackoverflow. I took help from the same.
Link:
https://stackoverflow.com/questions/956379/how-can-i-word-wrap-a-string-in-perl
Apart from it, perl also provides a wrap function using module Text::Wrap, but I wasn't sure if I could use this module in my changes. So, I proceeded with regex.

Quoted 4 lines

A single commit tells us very little if this rule in checkpatch.pl really is a good rule or not. A proper evaluation of typical cases of long commit lines would help much more to improve this rule.

I generated a list of commit_long_long_line warnings with the line for which they are occurring at:(v4.13..v5.8)
https://github.com/AdityaSrivast/kernel-tasks/blob/master/Task6/summary.txt

As I could see, most of these messages are plain english. But there are few instances of links, hex, file locations, such as:

1)https://lore.kernel.org/lkml/[email protected]/

2) /home6/tmricht/linux-next/tools/build/Makefile.build:96: recipe for target 'libbpf.o' failed

3) 8b 35 7b fb e2 00 mov 0xe2fb7b(%rip),%esi # ffffffff82db9e64
<nr_cpu_ids>

I think we can use a better regex like:
s/(.{1,75}|\S{76,})(?:\s[^\S\r\n]*|\Z)/$1\n/g

I tested this regex with the above cases, in which
1) remains unaffected
2) gets wrapped at "..recipe for" (which is 69 chars in length)
3) gets wrapped at "# ffffffff82db9e64", which is 64 in length

I guess I can generate another file with how these lines will be changed, when used with fix option.
What do you think?

Thanks
Aditya
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#4 lore raw
Quoted 53 lines · Aditya
Quoted 42 lines · Lukas Bulwahn
Quoted 40 lines · Aditya
Quoted 10 lines · Aditya Srivastava

Currently, when a line exceeds 75 characters in a commit message, checkpatch.pl gives a warning corresponding to the same.

E.g., running checkpatch on commit a1af2afbd244 ("drm/nouveau/volt:Fix for some cards having 0 maximum voltage") we get this warning:

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)

Some, mostly Fermi, vbioses appear to have zero max voltage. That causes

Nouveau to not parse voltage entries, thus users not being able to set higher clocks.

Quoted 15 lines

Provide a fix by consuming first 70 chars of the corresponding line, then stop at the next whitespace, and substitute it with the consumed chars and a newline char.

---
 scripts/checkpatch.pl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +0 -0
index 5a1096a4e220..ee665208ef02 100755

scripts/checkpatch.pl sub process { · line 2885

Quoted 5 lines
scripts/checkpatch.pl +0 -2
@@ -2881,8 +2881,11 @@ sub process {
                    $line =~ /^\s*(?:Fixes:|Link:)/i ||
                                      # A Fixes: or Link: line
                    $commit_log_possible_stack_dump)) {
-                     WARN("COMMIT_LOG_LONG_LINE",
-                          "Possible unwrapped commit description

(prefer a maximum 75 chars per line)\n" . $herecurr);

scripts/checkpatch.pl sub process { · line 2885

Quoted 2 lines
scripts/checkpatch.pl +2 -0
+                     if (WARN("COMMIT_LOG_LONG_LINE",
+                              "Possible unwrapped commit description

(prefer a maximum 75 chars per line)\n" . $herecurr) &&

scripts/checkpatch.pl sub process { · line 2887

Quoted 2 lines
scripts/checkpatch.pl +2 -0
+                         $fix) {
+                             $fixed[$fixlinenr] =~

s/(.{70}[^\s]*)\s+/$1\n/g;

Quoted 9 lines
Quoted 6 lines

scripts/checkpatch.pl sub process { · line 2891

Quoted 5 lines
scripts/checkpatch.pl +1 -0
+                     }
                      $commit_log_long_line = 1;
              }
 

Why do you not implement a proper word wrap function?

Quoted 6 lines

Actually, I had searched on the web regarding it before implementation. Here I have implemented text wrap only and regex is the best way I could find of implementing it. Also the same was advised at stackoverflow. I took help from the same.
Link:
https://stackoverflow.com/questions/956379/how-can-i-word-wrap-a-string-in-perl

And stackoverflow is not always a good reference.

Quoted 4 lines

Apart from it, perl also provides a wrap function using module Text::Wrap, but I wasn't sure if I could use this module in my changes. So, I proceeded with regex.

You can look into that, understand it a bit and then just implement a word wrap from scratch as we would need it here in checkpatch.pl, it should not be that complicated.

Quoted 5 lines
Quoted 4 lines

A single commit tells us very little if this rule in checkpatch.pl really is a good rule or not. A proper evaluation of typical cases of long commit lines would help much more to improve this rule.

Quoted 7 lines

I generated a list of commit_long_long_line warnings with the line for which they are occurring at:(v4.13..v5.8)
https://github.com/AdityaSrivast/kernel-tasks/blob/master/Task6/summary.txt

As I could see, most of these messages are plain english. But there are few instances of links, hex, file locations, such as:

I see many false positive warnings; so most are cases where I would not break the line.

Quoted 2 lines

1)https://lore.kernel.org/lkml/[email protected]/

How about detecting all likely URLs and suggesting a proper Link: tag in front of them?

Quoted 9 lines

2) /home6/tmricht/linux-next/tools/build/Makefile.build:96: recipe for target 'libbpf.o' failed

3) 8b 35 7b fb e2 00 mov 0xe2fb7b(%rip),%esi # ffffffff82db9e64
<nr_cpu_ids>

I think we can use a better regex like:
s/(.{1,75}|\S{76,})(?:\s[^\S\r\n]*|\Z)/$1\n/g

Quoted 9 lines

I tested this regex with the above cases, in which
1) remains unaffected
2) gets wrapped at "..recipe for" (which is 69 chars in length)
3) gets wrapped at "# ffffffff82db9e64", which is 64 in length

I guess I can generate another file with how these lines will be changed, when used with fix option.
What do you think?

I think 1, 2 and 3 should not be wrapped.

1) should be fixed by adding a Link: prefix.
2) should be warned to just drop the absolute path or so.
2) and 3) need to detected to be tool output and hence, we accept a longer line limit here.

I also see a few tags and long commit log warnings.

Does checkpatch.pl also warn on long tags? That should be excluded from that check.

Also, I noticed quite a few 'References: <git-sha> ("<git commit message>")'. I think there is no standard for this yet, but maybe that is worth a discussion to agree on something and then add documentation and a check for that.

Lukas
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

author
#5 lore raw
Quoted 16 lines · Lukas Bulwahn
Quoted 10 lines · Aditya
Quoted 3 lines

Why do you not implement a proper word wrap function?

Actually, I had searched on the web regarding it before implementation. Here I have implemented text wrap only and regex is the best way I could find of implementing it. Also the same was advised at stackoverflow. I took help from the same.
Link:
https://stackoverflow.com/questions/956379/how-can-i-word-wrap-a-string-in-perl

And stackoverflow is not always a good reference.

Quoted 9 lines
Quoted 4 lines

Apart from it, perl also provides a wrap function using module Text::Wrap, but I wasn't sure if I could use this module in my changes. So, I proceeded with regex.

You can look into that, understand it a bit and then just implement a word wrap from scratch as we would need it here in checkpatch.pl, it should not be that complicated.

Okay.

Quoted 13 lines
Quoted 5 lines
Quoted 4 lines

A single commit tells us very little if this rule in checkpatch.pl really is a good rule or not. A proper evaluation of typical cases of long commit lines would help much more to improve this rule.

Quoted 7 lines

I generated a list of commit_long_long_line warnings with the line for which they are occurring at:(v4.13..v5.8)
https://github.com/AdityaSrivast/kernel-tasks/blob/master/Task6/summary.txt

As I could see, most of these messages are plain english. But there are few instances of links, hex, file locations, such as:

Quoted 9 lines

I see many false positive warnings; so most are cases where I would not break the line.

Quoted 2 lines

1)https://lore.kernel.org/lkml/[email protected]/

How about detecting all likely URLs and suggesting a proper Link: tag in front of them?

Should we add another warning description for this one? Or while fixing, just prefix it with 'Link:'?

Quoted 14 lines
Quoted 14 lines

2) /home6/tmricht/linux-next/tools/build/Makefile.build:96: recipe for target 'libbpf.o' failed

3) 8b 35 7b fb e2 00 mov 0xe2fb7b(%rip),%esi # ffffffff82db9e64
<nr_cpu_ids>

I think we can use a better regex like:
s/(.{1,75}|\S{76,})(?:\s[^\S\r\n]*|\Z)/$1\n/g

I tested this regex with the above cases, in which
1) remains unaffected
2) gets wrapped at "..recipe for" (which is 69 chars in length)
3) gets wrapped at "# ffffffff82db9e64", which is 64 in length

Quoted 8 lines
Quoted 4 lines

I guess I can generate another file with how these lines will be changed, when used with fix option.
What do you think?

I think 1, 2 and 3 should not be wrapped.

1) should be fixed by adding a Link: prefix

Okay.

Quoted 1 line

2) should be warned to just drop the absolute path or so.

We are already warning for the absolute path for this case. All these warnings are emitted for:
Commit 1ce6a9fc1549 ("bpf: fix build error in libbpf with EXTRA_CFLAGS="-Wp, -D_FORTIFY_SOURCE=2 -O2"")

I guess for (2), we can check if a line is reported by USE_RELATIVE_PATH, we can omit it for long line warning

Quoted 3 lines

2) and 3) need to detected to be tool output and hence, we accept a longer line limit here.

So, we should wrap these lines after more characters? Or can we treat them as false positives for this warning and just avoid checking such lines for this class of warning?

Quoted 5 lines

I also see a few tags and long commit log warnings.

Does checkpatch.pl also warn on long tags? That should be excluded from that check.

Yes, checkpatch warns currently if we use long commit logs. Eg for commit '47987970175 ("ASoC: Intel: create haswell folder and move haswell platform files in")'

we get:
WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#13:
commit ba57f68235cf ("ASoC: Intel: create haswell folder and move haswell platform files in")

But probably it will be best if we can wrap these line. I feel so, as users tend to use these along the common english lines, and not always in a different line, such as:

- MC-aware mode was introduced to mlxsw in commit 7b8195306694 ("mlxsw: spectrum:

for the commit f9d5b1d50840.

Also I feel that wrapping it might not affect readability as well. For eg, I have wrapped the commit messages for my patches as well.

E.g., at,
https://lore.kernel.org/lkml/[email protected]/
I wrapped the 'E.g.' line which describes that I ran checkpatch.pl, and contains the commit message.

What do you think?

Quoted 5 lines

Also, I noticed quite a few 'References: <git-sha> ("<git commit message>")'. I think there is no standard for this yet, but maybe that is worth a discussion to agree on something and then add documentation and a check for that.

Thanks for pointing it out. I observed all the lines prefixed by 'References' and found out that they are either followed by link or commit log, except once ie
"I/O hangs after resuming from suspend-to-ram"
(https://marc.info/?l=linux-block&m=150340235201348).
Here user is probably quoting his line and referencing it to the link where he might have seen it.

I guess we can either avoid the line prefixed with 'References:' completely or selectively avoid links and treat commit logs similar to whatever we decide for above.

Thanks
Aditya
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#6 lore raw
Quoted 48 lines · Aditya
Quoted 16 lines · Lukas Bulwahn
Quoted 10 lines · Aditya
Quoted 3 lines

Why do you not implement a proper word wrap function?

Actually, I had searched on the web regarding it before implementation. Here I have implemented text wrap only and regex is the best way I could find of implementing it. Also the same was advised at stackoverflow. I took help from the same.
Link:
https://stackoverflow.com/questions/956379/how-can-i-word-wrap-a-string-in-perl

And stackoverflow is not always a good reference.

Quoted 9 lines
Quoted 4 lines

Apart from it, perl also provides a wrap function using module Text::Wrap, but I wasn't sure if I could use this module in my changes. So, I proceeded with regex.

You can look into that, understand it a bit and then just implement a word wrap from scratch as we would need it here in checkpatch.pl, it should not be that complicated.

Okay.

Quoted 19 lines
Quoted 5 lines
Quoted 4 lines

A single commit tells us very little if this rule in checkpatch.pl really is a good rule or not. A proper evaluation of typical cases of long commit lines would help much more to improve this rule.

Quoted 7 lines

I generated a list of commit_long_long_line warnings with the line for which they are occurring at:(v4.13..v5.8)
https://github.com/AdityaSrivast/kernel-tasks/blob/master/Task6/summary.txt

As I could see, most of these messages are plain english. But there are few instances of links, hex, file locations, such as:

I see many false positive warnings; so most are cases where I would not break the line.

Quoted 2 lines

1)https://lore.kernel.org/lkml/[email protected]/

Quoted 7 lines
Quoted 3 lines

How about detecting all likely URLs and suggesting a proper Link: tag in front of them?

Should we add another warning description for this one? Or while fixing, just prefix it with 'Link:'?

This should first be another warning, that is the first patch. Then, we can create some fix option for that warning. That is a second patch.

Quoted 27 lines
Quoted 14 lines
Quoted 14 lines

2) /home6/tmricht/linux-next/tools/build/Makefile.build:96: recipe for target 'libbpf.o' failed

3) 8b 35 7b fb e2 00 mov 0xe2fb7b(%rip),%esi # ffffffff82db9e64
<nr_cpu_ids>

I think we can use a better regex like:
s/(.{1,75}|\S{76,})(?:\s[^\S\r\n]*|\Z)/$1\n/g

I tested this regex with the above cases, in which
1) remains unaffected
2) gets wrapped at "..recipe for" (which is 69 chars in length)
3) gets wrapped at "# ffffffff82db9e64", which is 64 in length

Quoted 8 lines
Quoted 4 lines

I guess I can generate another file with how these lines will be changed, when used with fix option.
What do you think?

I think 1, 2 and 3 should not be wrapped.

1) should be fixed by adding a Link: prefix

Okay.

Quoted 1 line

2) should be warned to just drop the absolute path or so.

Quoted 8 lines

We are already warning for the absolute path for this case. All these warnings are emitted for:
Commit 1ce6a9fc1549 ("bpf: fix build error in libbpf with EXTRA_CFLAGS="-Wp, -D_FORTIFY_SOURCE=2 -O2"")

I guess for (2), we can check if a line is reported by USE_RELATIVE_PATH, we can omit it for long line warning

No, we might consider a different output for tool output.

Quoted 7 lines
Quoted 3 lines

2) and 3) need to detected to be tool output and hence, we accept a longer line limit here.

So, we should wrap these lines after more characters? Or can we treat them as false positives for this warning and just avoid checking such lines for this class of warning?

We should warn at a longer line limit.

Quoted 9 lines
Quoted 5 lines

I also see a few tags and long commit log warnings.

Does checkpatch.pl also warn on long tags? That should be excluded from that check.

Yes, checkpatch warns currently if we use long commit logs. Eg for commit '47987970175 ("ASoC: Intel: create haswell folder and move haswell platform files in")'

Quoted 7 lines

we get:
WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#13:
commit ba57f68235cf ("ASoC: Intel: create haswell folder and move haswell platform files in")

I wrote tags. I think tag lines should not be warned about long length (or at least for a different length).

Quoted 32 lines

But probably it will be best if we can wrap these line. I feel so, as users tend to use these along the common english lines, and not always in a different line, such as:

- MC-aware mode was introduced to mlxsw in commit 7b8195306694 ("mlxsw: spectrum:

for the commit f9d5b1d50840.

Also I feel that wrapping it might not affect readability as well. For eg, I have wrapped the commit messages for my patches as well.

E.g., at,
https://lore.kernel.org/lkml/[email protected]/
I wrapped the 'E.g.' line which describes that I ran checkpatch.pl, and contains the commit message.

What do you think?

Quoted 5 lines

Also, I noticed quite a few 'References: <git-sha> ("<git commit message>")'. I think there is no standard for this yet, but maybe that is worth a discussion to agree on something and then add documentation and a check for that.

Thanks for pointing it out. I observed all the lines prefixed by 'References' and found out that they are either followed by link or commit log, except once ie
"I/O hangs after resuming from suspend-to-ram"
(https://marc.info/?l=linux-block&m=150340235201348).
Here user is probably quoting his line and referencing it to the link where he might have seen it.

Quoted 4 lines

I guess we can either avoid the line prefixed with 'References:' completely or selectively avoid links and treat commit logs similar to whatever we decide for above.

That is a reasonable checkpatch.pl rule and can deserve a fix option as well.

Lukas
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees