[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1] scripts/checkpatch.pl: check for placeholders in cover le
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH v1] scripts/checkpatch.pl: check for placeholders in cover letter patches |
Date: |
Tue, 30 Jan 2024 08:12:25 +0000 |
User-agent: |
Mutt/2.2.12 (2023-09-09) |
On Tue, Jan 30, 2024 at 09:56:15AM +0200, Manos Pitsidianakis wrote:
> Check if a file argument is a cover letter patch produced by
> git-format-patch --cover-letter; It is initialized with subject suffix "
> *** SUBJECT HERE ***" and body prefix " *** BLURB HERE ***". If they
> exist, warn the user.
>
> Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
> scripts/checkpatch.pl | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 7026895074..34f12c9848 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1650,6 +1650,20 @@ sub process {
> $non_utf8_charset = 1;
> }
>
> +# Check if this is a cover letter patch produced by git-format-patch
> +# --cover-letter; It is initialized with subject suffix
> +# " *** SUBJECT HERE ***" and body prefix " *** BLURB HERE ***"
> + if ($in_header_lines &&
> + $rawline =~ /^Subject:.+[*]{3} SUBJECT HERE [*]{3}\s*$/) {
> + WARN("Patch appears to be a cover letter with uninitialized subject"
> .
> + " '*** SUBJECT HERE ***'\n$hereline\n");
> + }
> +
> + if ($rawline =~ /^[*]{3} BLURB HERE [*]{3}\s*$/) {
> + WARN("Patch appears to be a cover letter with leftover placeholder "
> .
> + "text '*** BLURB HERE ***'\n$hereline\n");
> + }
Indentation here is totally off
> +
> if ($in_commit_log && $non_utf8_charset && $realfile =~ /^$/ &&
> $rawline =~ /$NON_ASCII_UTF8/) {
> WARN("8-bit UTF-8 used in possible commit log\n" .
> $herecurr);
>
> base-commit: 11be70677c70fdccd452a3233653949b79e97908
> --
> γαῖα πυρί μιχθήτω
>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|