From: William McVicker <willmcvicker@google.com>
To: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>,
Dwaipayan Ray <dwaipayanray1@gmail.com>,
Lukas Bulwahn <lukas.bulwahn@gmail.com>,
linux-kbuild@vger.kernel.org, kernel-team@android.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] checkpatch: allow build files to reference other build files
Date: Fri, 12 Jan 2024 14:16:49 -0800 [thread overview]
Message-ID: <ZaG6UcGSrxduqtFH@google.com> (raw)
In-Reply-To: <3513adb04d17156242c92121a7aec4515c39bcf5.camel@perches.com>
On 01/12/2024, Joe Perches wrote:
> On Fri, 2024-01-12 at 10:34 -0800, Will McVicker wrote:
> > Add an exception to the EMBEDDED_FILENAME warning for build files. This
> > fixes the below warnings where the Kconfig and Makefile files reference
> > other similarly named build files.
> >
> > WARNING:EMBEDDED_FILENAME: It's generally not useful to have the
> > filename in the file
> > #24: FILE: Kconfig:34:
> > +source "drivers/willmcvicker/Kconfig"
> >
> > WARNING:EMBEDDED_FILENAME: It's generally not useful to have the
> > filename in the file
> > #36: FILE: Makefile:667:
> > + } > Makefile
>
> No need to wrap here I think.
You're right. I'll update in v2.
>
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
> > @@ -3785,7 +3785,9 @@ sub process {
> > }
> >
> > # check for embedded filenames
> > - if ($rawline =~ /^\+.*\b\Q$realfile\E\b/) {
> > + if ($rawline =~ /^\+.*\b\Q$realfile\E\b/ &&
> > + $realfile !~ /Kconfig.*/ &&
> > + $realfile !~ /Makefile.*/) {
>
> Align to open parenthesis please.
> It's not useful to have .* before the /
I was following other references in this file, but looks like you're right that
it's not needed. Your recommendation passed the tests I have. So I'll update
the regex in v2.
Thanks,
Will
>
> So perhaps better to be
>
> if ($rawline =~ /^\+.*\b\Q$realfile\E\b/ &&
> $realfile !~ /(?:Kconfig|Makefile)/) {
>
> > WARN("EMBEDDED_FILENAME",
> > "It's generally not useful to have the filename in the file\n" . $herecurr);
> > }
>
prev parent reply other threads:[~2024-01-12 22:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-12 18:34 [PATCH v1] checkpatch: allow build files to reference other build files Will McVicker
2024-01-12 18:48 ` Joe Perches
2024-01-12 22:16 ` William McVicker [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZaG6UcGSrxduqtFH@google.com \
--to=willmcvicker@google.com \
--cc=apw@canonical.com \
--cc=dwaipayanray1@gmail.com \
--cc=joe@perches.com \
--cc=kernel-team@android.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox