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.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 C2CD3C433E7 for ; Mon, 12 Oct 2020 15:23:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8DFBE208B6 for ; Mon, 12 Oct 2020 15:23:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389669AbgJLPXl (ORCPT ); Mon, 12 Oct 2020 11:23:41 -0400 Received: from smtprelay0138.hostedemail.com ([216.40.44.138]:52218 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388984AbgJLPXl (ORCPT ); Mon, 12 Oct 2020 11:23:41 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 634A5180A7FCF; Mon, 12 Oct 2020 15:23:40 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: twist43_3b049cd271fb X-Filterd-Recvd-Size: 2477 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf12.hostedemail.com (Postfix) with ESMTPA; Mon, 12 Oct 2020 15:23:36 +0000 (UTC) Message-ID: Subject: Re: [RFC PATCH] checkpatch: add shebang check to EXECUTE_PERMISSIONS From: Joe Perches To: Lukas Bulwahn , Ujjwal Kumar Cc: linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Date: Mon, 12 Oct 2020 08:23:35 -0700 In-Reply-To: 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 16:16 +0200, Lukas Bulwahn wrote: > On Mon, 12 Oct 2020, 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. [] > > Should these new changes go as a separate patch or can they be > > included in the next iteration of this patch? [] The commit log should be updated with the example shown. Please send a clean V2.