If there are multiple patches/files on the command line, use a prefix before the patch/file message output like: -------------- patch/filename -------------- to make the identifying which messages go with which file/patch a bit easier to parse. Move the perl version and false positive messages after all the files have been scanned so that they are emitted only once. Standardize the NOTE: <...> form to always emit a blank line before the NOTE and always use print << "EOM" style.
Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all
Unified · Split
| @@ -197,11 +197,11 @@ sub hash_show_words { · 196 unmodified lines | ||
| 197 | 197 | my ($hashRef, $prefix) = @_; |
| 198 | 198 | |
| 199 | 199 | if ($quiet == 0 && keys %$hashRef) { |
| 200 | − print "NOTE: $prefix message types:"; | |
| 200 | + print "\nNOTE: $prefix message types:"; | |
| 201 | 201 | foreach my $word (sort keys %$hashRef) { |
| 202 | 202 | print " $word"; |
| 203 | 203 | } |
| 204 | − print "\n\n"; | |
| 204 | + print "\n"; | |
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | |
| @@ -741,6 +741,13 @@ for my $filename (@ARGV) { · 533 unmodified lines | ||
| 741 | 741 | push(@rawlines, $_); |
| 742 | 742 | } |
| 743 | 743 | close($FILE); |
| 744 | + | |
| 745 | + if ($#ARGV > 0 && $quiet == 0) { | |
| 746 | + print '-' x length($vname) . "\n"; | |
| 747 | + print "$vname\n"; | |
| 748 | + print '-' x length($vname) . "\n"; | |
| 749 | + } | |
| 750 | + | |
| 744 | 751 | if (!process($filename)) { |
| 745 | 752 | $exit = 1; |
| 746 | 753 | } |
| @@ -755,6 +762,23 @@ for my $filename (@ARGV) { · 8 unmodified lines | ||
| 755 | 762 | build_types(); |
| 756 | 763 | } |
| 757 | 764 | |
| 765 | +if (!$quiet) { | |
| 766 | + if ($^V lt 5.10.0) { | |
| 767 | + print << "EOM" | |
| 768 | + | |
| 769 | +NOTE: perl $^V is not modern enough to detect all possible issues. | |
| 770 | + An upgrade to at least perl v5.10.0 is suggested. | |
| 771 | +EOM | |
| 772 | + } | |
| 773 | + if ($exit) { | |
| 774 | + print << "EOM" | |
| 775 | + | |
| 776 | +NOTE: If any of the errors are false positives, please report | |
| 777 | + them to the maintainer, see CHECKPATCH in MAINTAINERS. | |
| 778 | +EOM | |
| 779 | + } | |
| 780 | +} | |
| 781 | + | |
| 758 | 782 | exit($exit); |
| 759 | 783 | |
| 760 | 784 | sub top_of_kernel_tree { |
| @@ -5578,22 +5602,18 @@ sub process { · 4817 unmodified lines | ||
| 5578 | 5602 | print "total: $cnt_error errors, $cnt_warn warnings, " . |
| 5579 | 5603 | (($check)? "$cnt_chk checks, " : "") . |
| 5580 | 5604 | "$cnt_lines lines checked\n"; |
| 5581 | − print "\n" if ($quiet == 0); | |
| 5582 | 5605 | } |
| 5583 | 5606 | |
| 5584 | 5607 | if ($quiet == 0) { |
| 5585 | − | |
| 5586 | − if ($^V lt 5.10.0) { | |
| 5587 | − print("NOTE: perl $^V is not modern enough to detect all possible issues.\n"); | |
| 5588 | − print("An upgrade to at least perl v5.10.0 is suggested.\n\n"); | |
| 5589 | − } | |
| 5590 | − | |
| 5591 | 5608 | # If there were whitespace errors which cleanpatch can fix |
| 5592 | 5609 | # then suggest that. |
| 5593 | 5610 | if ($rpt_cleaners) { |
| 5594 | − print "NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or\n"; | |
| 5595 | − print " scripts/cleanfile\n\n"; | |
| 5596 | 5611 | $rpt_cleaners = 0; |
| 5612 | + print << "EOM" | |
| 5613 | + | |
| 5614 | +NOTE: Whitespace errors detected. | |
| 5615 | + You may wish to use scripts/cleanpatch or scripts/cleanfile | |
| 5616 | +EOM | |
| 5597 | 5617 | } |
| 5598 | 5618 | } |
| 5599 | 5619 | |
| @@ -5627,6 +5647,7 @@ sub process { · 27 unmodified lines | ||
| 5627 | 5647 | |
| 5628 | 5648 | if (!$quiet) { |
| 5629 | 5649 | print << "EOM"; |
| 5650 | + | |
| 5630 | 5651 | Wrote EXPERIMENTAL --fix correction(s) to '$newfile' |
| 5631 | 5652 | |
| 5632 | 5653 | Do _NOT_ trust the results written to this file. |
| @@ -5634,22 +5655,17 @@ Do _NOT_ submit these changes without inspecting them for correctness. · 1 unmodified line | ||
| 5634 | 5655 | |
| 5635 | 5656 | This EXPERIMENTAL file is simply a convenience to help rewrite patches. |
| 5636 | 5657 | No warranties, expressed or implied... |
| 5637 | − | |
| 5638 | 5658 | EOM |
| 5639 | 5659 | } |
| 5640 | 5660 | } |
| 5641 | 5661 | |
| 5642 | − if ($clean == 1 && $quiet == 0) { | |
| 5643 | − print "$vname has no obvious style problems and is ready for submission.\n" | |
| 5644 | − } | |
| 5645 | − if ($clean == 0 && $quiet == 0) { | |
| 5646 | − print << "EOM"; | |
| 5647 | −$vname has style problems, please review. | |
| 5648 | − | |
| 5649 | −If any of these errors are false positives, please report | |
| 5650 | −them to the maintainer, see CHECKPATCH in MAINTAINERS. | |
| 5651 | −EOM | |
| 5662 | + if ($quiet == 0) { | |
| 5663 | + print "\n"; | |
| 5664 | + if ($clean == 1) { | |
| 5665 | + print "$vname has no obvious style problems and is ready for submission.\n"; | |
| 5666 | + } else { | |
| 5667 | + print "$vname has style problems, please review.\n"; | |
| 5668 | + } | |
| 5652 | 5669 | } |
| 5653 | − | |
| 5654 | 5670 | return $clean; |
| 5655 | 5671 | } |