From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13721C433DF for ; Mon, 12 Oct 2020 15:08:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D4AF52074F for ; Mon, 12 Oct 2020 15:08:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389372AbgJLPI1 (ORCPT ); Mon, 12 Oct 2020 11:08:27 -0400 Received: from smtprelay0186.hostedemail.com ([216.40.44.186]:34288 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388977AbgJLPI1 (ORCPT ); Mon, 12 Oct 2020 11:08:27 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id 66A0E100E7B40; Mon, 12 Oct 2020 15:08:26 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: rest16_26084c1271fb X-Filterd-Recvd-Size: 2325 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf15.hostedemail.com (Postfix) with ESMTPA; Mon, 12 Oct 2020 15:08:25 +0000 (UTC) Message-ID: Subject: Re: [RFC PATCH] checkpatch: add shebang check to EXECUTE_PERMISSIONS From: Joe Perches To: Ujjwal Kumar , Lukas Bulwahn Cc: linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Date: Mon, 12 Oct 2020 08:08:24 -0700 In-Reply-To: <5a3fc45f-e5d7-da3d-4b4b-2a23512ff8de@gmail.com> References: <20201012054943.1196031-1-ujjwalkumar0501@gmail.com> <63053585d41ff81cdaad6cb727eb83d81207041a.camel@perches.com> <5a3fc45f-e5d7-da3d-4b4b-2a23512ff8de@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-10-12 at 19:22 +0530, Ujjwal Kumar wrote: > On 12/10/20 11:47 am, Joe Perches wrote: > > On Mon, 2020-10-12 at 11:19 +0530, 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. Please add verbiage like this to the commit message. > Should these new changes go as a separate patch or can they be > included in the next iteration of this patch? V2 please.