[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <35f626fb-9524-a7e3-664f-1b3150fe08c8@leemhuis.info>
Date: Fri, 9 Dec 2022 10:33:17 +0100
From: Thorsten Leemhuis <linux@...mhuis.info>
To: Joe Perches <joe@...ches.com>,
Kai Wasserbäch <kai@....carbon-project.org>,
linux-kernel@...r.kernel.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Andy Whitcroft <apw@...onical.com>,
Dwaipayan Ray <dwaipayanray1@...il.com>,
Lukas Bulwahn <lukas.bulwahn@...il.com>
Subject: Re: [PATCH 1/2] checkpatch: warn when unknown tags are used for links
On 08.12.22 20:58, Joe Perches wrote:
> On Thu, 2022-12-08 at 20:32 +0100, Kai Wasserbäch wrote:
>> Issue a warning when encountering URLs behind unknown tags, as Linus
>> recently stated ```please stop making up random tags that make no sense.
>> Just use "Link:"```[1]. That statement was triggered by an use of
>> 'BugLink', but that's not the only tag people invented:
>>
>> $ git log -100000 --format=email -P --grep='^\w+:[ \t]*http' | \
>
> Please use the --no-merges output
Done, good point.
> [...]
>> @@ -3239,6 +3239,13 @@ sub process {
>> $commit_log_possible_stack_dump = 0;
>> }
>>
>> +# Check for odd tags before a URI/URL
>> + if ($in_commit_log &&
>> + $line =~ /^\s*(\w+):\s*http/ && $1 !~ /^Link/) {
>> + WARN("COMMIT_LOG_USE_LINK",
>> + "Unknown link reference '$1:', use 'Link:' instead.\n" . $herecurr);
>
> This would allow LinkFoo: so better would be
>
> $line =~ /^\s*(\w+):\s*http/ && $1 ne 'Link')
> or
> $line =~ /^\s*(\w+):\s*http/ && $1 !~ /^Link$/) {
>
> (and checkpatch doesn't use periods after output messages)
>
> Maybe better as well would be to use something like the below to
> better describe the preferred location of patch versioning info.
>
> # Check for odd tags before a URI/URL
> if ($in_commit_log &&
> $line =~ /^\s*(\w+):\s*http/ && $1 ne 'Link') {
> if ($1 =~ /^v(?:ersion)?\d+/i) {
> WARN("COMMIT_LOG_VERSIONING",
> "Patch version information should be after the --- line\n" . $herecurr);
> } else {
> WARN("COMMIT_LOG_USE_LINK",
> "Unknown link reference '$1:', use 'Link:' instead\n" . $herecurr);
> }
> }
>
Yeah, that looks like a really good idea. I went with that. But I'd say
this is the point where this really warrants a Co-developed-by: that
mentions you (and thus a Signed-off-by: from your side, too), don't you
think so?
Ciao, Thorsten
Powered by blists - more mailing lists