Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1080960rdb; Fri, 1 Dec 2023 06:39:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEhCxQKfFSUhZkBugAkYdwsfXAQRepTsJ91Bf1YvnwjQzH0Tml58rfMqni+FsS9fbxSC2IF X-Received: by 2002:a05:6e02:1090:b0:35d:484f:c0f3 with SMTP id r16-20020a056e02109000b0035d484fc0f3mr3227693ilj.17.1701441586734; Fri, 01 Dec 2023 06:39:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701441586; cv=none; d=google.com; s=arc-20160816; b=R+u70+9CXt3kGnr4RdJQGP/tvUH8fo1Y8qsrr6XGSiahQJfKAgG5DjoaHKLEXgOQzl jKOGHO6lBbHPBVjICLqXMIoyU/dvBNeGzgHdy9VwBTicjqQb4NXl76KE6zuMrtXz9pZ5 b/fVDMDk7FnKKXqfKQzGbrm9TxKwpeWBmKUYAqAlXjDdJHXblt7uvDwnX6xXSVwppRd3 Hp2qFZVwWS7Isb961FL51aPPz0qAZMT3fVa0PlwtXLxRfA71i8CxRUeh7mV6Sx5BAEun uHLNIa3Igw0KQUO1tHJUUuJKMd5eb5IJfdpaJr1A8I/VMZD9pksa0hgMW5SFRBXVy5Vj oPSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=QaUeVu47uYKBL0gnDZHJVeDqzsASI+wzCCg+8nFT04U=; fh=hmg3ON52M73IyY5qB9agiHOaS1ZV+nd5tIW1j26goCk=; b=Mq0nIJvy6b/mjBBt4YJ3JAl6g11EFFDGZpiFYkBwEzGFXNXansEjqVp4xxag8uohsp BTsukcLjJV1r2lHrX5RZEOE9LZb/BuLcvARPlSP7CC91UyUjowapFalDixuJV3QoKzeL 56tY8IafLF0IHGVU5Oz6BAbkLBoSUTbGYcyebZ/K4UX7LBycn6HqcfyoINjIs6ughJXt 7lYKFpxrAJIkJsuA3xm3k1y1L+WOsYVdC1zYY9IS5qZkz64aagbZIsK5CwI7iUryozlf NKXg7wSR2xSk7PVK13HiCLo83EloEdfFirQfUTKV1ES3WxoDUr3koUJsRtnmNzDjd20Y dzpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=link.tyut.edu.cn Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id k67-20020a632446000000b005b9083b81f5si3516730pgk.487.2023.12.01.06.39.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 06:39:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=link.tyut.edu.cn Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9EF1A801B422; Fri, 1 Dec 2023 06:39:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379175AbjLAOjd (ORCPT + 99 others); Fri, 1 Dec 2023 09:39:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379206AbjLAOj3 (ORCPT ); Fri, 1 Dec 2023 09:39:29 -0500 Received: from mail-m49198.qiye.163.com (mail-m49198.qiye.163.com [45.254.49.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C2AD1711 for ; Fri, 1 Dec 2023 06:39:30 -0800 (PST) Received: from [172.23.111.174] (unknown [111.52.6.202]) by mail-m121145.qiye.163.com (Hmail) with ESMTPA id 2C3B6800094; Fri, 1 Dec 2023 22:39:02 +0800 (CST) Message-ID: Date: Fri, 1 Dec 2023 22:39:01 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] scripts/show_delta: reformat code Content-Language: en-US To: Nicolas Schier Cc: gregkh@linuxfoundation.org, akpm@linux-foundation.org, masahiroy@kernel.org, ndesaulniers@google.com, ojeda@kernel.org, linux-kernel@vger.kernel.org References: <20231201053540.9534-1-2023002089@link.tyut.edu.cn> From: Hu Haowen <2023002089@link.tyut.edu.cn> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVkaTEtDVhhLTB1IS0tIT0lIQ1UTARMWGhIXJBQOD1 lXWRgSC1lBWUpKSlVOSVVNVUlLSVlXWRYaDxIVHRRZQVlPS0hVSkhKTk1JVUpLS1VLWQY+ X-HM-Tid: 0a8c25d19942b03akuuu2c3b6800094 X-HM-MType: 10 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Kxg6HCo4Sjw*QxQCGiFICzcf CDRPCRhVSlVKTEtKT09KTk9IS01NVTMWGhIXVUlLSUhLS0lLQ0I7FxIVEFUPAg4PVR4fDlUYFUVZ V1kSC1lBWUpKSlVOSVVNVUlLSVlXWQgBWUFITkxINwY+ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 01 Dec 2023 06:39:45 -0800 (PST) On 2023/12/1 14:49, Nicolas Schier wrote: > On Fri, Dec 01, 2023 at 01:35:40PM +0800, Hu Haowen wrote: >> Correct some lines in irregular coding style to make them look more >> harmonious and fit the common coding regulations in Python. >> >> Signed-off-by: Hu Haowen <2023002089@link.tyut.edu.cn> >> --- >> scripts/show_delta | 18 +++++++++--------- >> 1 file changed, 9 insertions(+), 9 deletions(-) >> >> diff --git a/scripts/show_delta b/scripts/show_delta >> index 291ad65e3089..33446adce74b 100755 >> --- a/scripts/show_delta >> +++ b/scripts/show_delta >> @@ -13,7 +13,7 @@ import sys >> import string >> >> def usage(): >> - print ("""usage: show_delta [] >> + print("""usage: show_delta [] > Hi, > > thanks for your patch. What Miguel already noticed for v1 is valid for > v2, too: there are still inconsistencies in the coding style, e.g. > `print (...)` and `print(...)`. > > To simplify a consistent coding style for future work on the script, > using an external tool for reformatting (and mentioning it in the commit > message) would be helpful. Miguel suggested Black or Ruff, I think this > is a good idea. Just got a glimpse on the usage of Black and realized the convenience it provides and strictness of code style it supplies. It is pretty feasible for code style analysis series of Python scripts within the kernel source. However, here comes the issue that this tool binds itself to its own bunches of rules how the code should be formatted by default, resulting in some kind of scenes which do not match what we want when doing kernel programming, or more exactly this tool may not follow the rules regulated by the kernel developers or mentioned within kernel documentation, which means we are obliged to conduct a programming standard for Python coding within kernel source internally, and then ask Black to review and reformat the code accordingly. But this programming standard is absent currently, consequently it should be specified initially from my perspective. What is your idea on this? (The Black code style: https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html) Thanks, Hu Haowen > > Kind regards, > Nicolas