From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AFFD9A0032; Wed, 16 Mar 2022 07:29:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F212410EC; Wed, 16 Mar 2022 07:29:46 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 52DB540395 for ; Wed, 16 Mar 2022 07:29:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647412185; x=1678948185; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=e4di6PR6UieLWlbkg/1eegEmzlA8z6p2XtbEb1gWu9o=; b=e5yOoZClItH2RY/d5NyqYEMoRSpQ1nDCxezjCxHrVg5xE2ueNdbgNVVn YpdMtUjDSXA0zSp+GQdLQ+0GGmL/Wb8L7MdEQHBZfsVmEUdLpFIuumEGV KVIlRdmp2LsKD2lLQuULeRSnRiwrHApLZ5xTLv2pHbXpl4GSwgJGrGKTP kRYpCYmRQQpTQc0/Y5mD88xUoj3NPWfEypZF4UZK+mjqeth3/Ej3q4yYo r2ZNNFn+FiU7mP+OpYxB1K3Ny5EKJsdEWy9fjtVNleQ9N2addILFTD9XO j4iluYAnKCB5w/Fe5AVZtZsm8R2Oy/VG6uSLf19v4oyp0T0wR3CLY0AvW g==; X-IronPort-AV: E=McAfee;i="6200,9189,10286"; a="256693954" X-IronPort-AV: E=Sophos;i="5.90,185,1643702400"; d="scan'208";a="256693954" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2022 23:29:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,185,1643702400"; d="scan'208";a="557304726" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga008.jf.intel.com with ESMTP; 15 Mar 2022 23:29:41 -0700 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 15 Mar 2022 23:29:41 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX606.ccr.corp.intel.com (10.109.6.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 16 Mar 2022 14:29:39 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.2308.021; Wed, 16 Mar 2022 14:29:39 +0800 From: "Tu, Lijuan" To: "ohilyard@iol.unh.edu" , "dts@dpdk.org" Subject: RE: [PATCH] formatting_script: Add formatting script Thread-Topic: [PATCH] formatting_script: Add formatting script Thread-Index: AQHYLmVbDCOuWkendUCIUGNwGumJeazBoZOA Date: Wed, 16 Mar 2022 06:29:38 +0000 Message-ID: References: <20220302184255.35984-1-ohilyard@iol.unh.edu> In-Reply-To: <20220302184255.35984-1-ohilyard@iol.unh.edu> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.401.20 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Applied, thanks > -----Original Message----- > From: ohilyard@iol.unh.edu > Sent: 2022=1B$BG/=1B(B3=1B$B7n=1B(B3=1B$BF|=1B(B 2:43 > To: dts@dpdk.org > Cc: Tu, Lijuan ; Owen Hilyard > Subject: [PATCH] formatting_script: Add formatting script >=20 > From: Owen Hilyard >=20 > Added a formatting script to run black an isort with. By default, it will= run in the > current working directory. If $1 is specified and not either "-h" or "--h= elp", it will > run in that directory instead. This does not allow checking for a git dif= f after > formatting (for rejecting patches in CI), but that should be fairly easy = to > implement in a wrapper script. >=20 > Signed-off-by: Owen Hilyard > --- > format.sh | 35 +++++++++++++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) > create mode 100755 format.sh >=20 > diff --git a/format.sh b/format.sh > new file mode 100755 > index 00000000..d35c0bf1 > --- /dev/null > +++ b/format.sh > @@ -0,0 +1,35 @@ > +#!/usr/bin/env bash > + > +function main() { > + # The directory to work on is either passed in as argument 1, > + # or is the current working directory > + DIRECTORY=3D${1:-`pwd`} > + LINE_LENGTH=3D88 > + > + isort \ > + --overwrite-in-place \ > + --profile black \ > + -j `nproc` \ > + --line-length $LINE_LENGTH \ > + --python-version auto \ > + $DIRECTORY > + > + black \ > + --line-length $LINE_LENGTH \ > + --required-version 22.1.0 \ > + --target-version py38 \ > + --safe \ > + $DIRECTORY > +} > + > +function help() { > + echo "usage: format.sh " > +} > + > +if [ "$1" =3D=3D "-h" ] || [ "$1" =3D=3D "--help" ]; then > + help > + exit 0 > +fi > + > +main "$1" > + > -- > 2.30.2