From: Lukas Bulwahn <lukas.bulwahn@gmail.com>
To: Ujjwal Kumar <ujjwalkumar0501@gmail.com>
Cc: Joe Perches <joe@perches.com>,
linux-kernel-mentees@lists.linuxfoundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [Linux-kernel-mentees] [RFC PATCH v2] checkpatch: add shebang check to EXECUTE_PERMISSIONS
Date: Wed, 14 Oct 2020 07:46:39 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.21.2010140734270.6186@felia> (raw)
In-Reply-To: <20201013120129.1304101-1-ujjwalkumar0501@gmail.com>
On Tue, 13 Oct 2020, Ujjwal Kumar wrote:
> checkpatch.pl checks for invalid EXECUTE_PERMISSIONS on source
> files. The script leverages filename extensions and its path in
> the repository to decide whether to allow execute permissions on
> the file or not.
>
> Based on current check conditions, a perl script file having
> execute permissions, without '.pl' extension in its filename
> and not belonging to 'scripts/' directory is reported as ERROR
> which is a false positive.
>
> Adding a shebang check along with current conditions will make
> the check more generalised and improve checkpatch reports.
> To do so, without breaking the core design decision of checkpatch,
> we can fetch the first line from the patch itself and match it for
> a shebang pattern.
>
> There can be cases where the first line is not part of the patch.
> For instance: a patch that only changes permissions without
> changing any of the file content.
> In that case there may be a false positive report but in the end we
> will have less false positives as we will be handling some of the
> unhandled cases.
>
I get the intent of your addition. However:
I would bet that you only find one or two in a million commits, that would
actually benefit for this special check of a special case of a special
rule...
So given the added complexity of yet another 19 lines in checkpatch with
little benefit of lowering false positive reports, I would be against
inclusion.
You can provide convincing arguments with an evaluation, where you show
on how many commits this change would really make a difference...
It is probably better and simpler to just have a script checking for
execute bits on all files in the repository on linux-next (with a list of
known intended executable files) and just report to you and then to the
developers when a new file with unintentional execute bit appeared.
Keep up the good work. I just fear this patch is a dead end.
There is still a lot of other issues you can contribute to.
Just one bigger project example: Comparing clang-format suggestions on
patches against checkpatch.pl suggestions are fine-tuning both of them to fit to
the actual kernel style.
Lukas
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
next prev parent reply other threads:[~2020-10-14 5:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-13 12:01 [Linux-kernel-mentees] [RFC PATCH v2] checkpatch: add shebang check to EXECUTE_PERMISSIONS Ujjwal Kumar
2020-10-13 12:13 ` Ujjwal Kumar
2020-10-13 15:27 ` Joe Perches
2020-10-14 5:46 ` Lukas Bulwahn [this message]
2020-10-14 6:01 ` Joe Perches
2020-10-14 6:21 ` Lukas Bulwahn
2020-10-14 6:27 ` Joe Perches
2020-10-14 6:36 ` Lukas Bulwahn
2020-10-14 6:39 ` Joe Perches
2020-10-14 6:47 ` Lukas Bulwahn
2020-10-14 6:58 ` Joe Perches
2020-10-14 7:17 ` Lukas Bulwahn
2020-10-14 7:35 ` Joe Perches
2020-10-14 17:45 ` Miguel Ojeda
2020-10-14 18:05 ` Joe Perches
2020-10-14 18:32 ` Miguel Ojeda
2020-10-14 18:37 ` Joe Perches
2020-10-14 11:14 ` Ujjwal Kumar
2020-10-16 9:05 ` Ujjwal Kumar
2020-10-16 10:10 ` Lukas Bulwahn
2020-10-16 10:24 ` Dwaipayan Ray
2020-10-16 10:33 ` Lukas Bulwahn
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=alpine.DEB.2.21.2010140734270.6186@felia \
--to=lukas.bulwahn@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ujjwalkumar0501@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;
as well as URLs for NNTP newsgroup(s).