From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.6164.1608006689094030316 for ; Mon, 14 Dec 2020 20:31:29 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=pqI8B8c3; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: bob.c.feng@intel.com) IronPort-SDR: g9KRochTxfcDcAAb9plJjcHsZYeBft9cBlfPTqWurnVfZB5bDBO0S45WYVA6SfAUum+gtDcmvB HIuto7W0yppA== X-IronPort-AV: E=McAfee;i="6000,8403,9835"; a="154631343" X-IronPort-AV: E=Sophos;i="5.78,420,1599548400"; d="scan'208";a="154631343" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2020 20:31:28 -0800 IronPort-SDR: PtwAPbkSttflz4DRir0AM/DjgOOGIMxM1Nb5VUHLZ9pnq7jCPN4ks2hT31+M08fRpwxHQRiU6O XUuGOUUVS0Zw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,420,1599548400"; d="scan'208";a="450498562" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga001.fm.intel.com with ESMTP; 14 Dec 2020 20:31:28 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 14 Dec 2020 20:31:27 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 14 Dec 2020 20:31:27 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.104) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Mon, 14 Dec 2020 20:31:27 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i+WVgDvly/uovY7KpC4O5zEQ2caUtWpWvIkBWs0ijtCifGeSfcWE3vwRg04OPW246h+ge3JkkJD0RJR+QXYqjow1gK4+hMoZZCzllKUH8c3HDUkT8BRBpKFy5/Oj1l4V9oashGvuE59maw7vb51FwiFjY87ehxR5elMt92nT5RLZ0YbHiQnClmSHoyB2SiVfOZD9G/DSYeuGiGFl07EGQoA0GWe2bfMAQpORFHyMqK9ak4DrTROuxlsC4vqnLNV+cfx1Gqc5kEe8WidlcO26WG18uy7NZEtVD0Rq4KVstBC9pu3C7OF6+SYomdoijAxdw8ZYGn+IkbgsmU2t3B9n/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=skQjC4aVJEsB9h2Y/T5P2s9hHtbcd2V3cFzwR9By3TE=; b=NZcSrXDLivzJYnnDYJLJKP8YQTGZlH6Q8S8G3m23sD8XmJBED1lueZCDBfFn98dFCZ4mFvPfuxChnGI8knDeddxgs0GFJ8HOxLnVCTqFePRoH/SK+KwgG/1kuibAjGOkjyja8/JUWY/CHvwUtOgZ/65Wje2kXjNgDMLjf/J4zo2kbjQ/hGbGPg5lkLYYpywF0hrYn5jcnewzxPU6trPw4nxDcxAigt0u8n9mmoK/476exMaHOa0XqM5w2BQO8dAai7Ywb/Si9s7m8xQEq5yF13aP3pDFcel/skoDgzXjH7QAHXQZPxzgECxJ/HdrI9nPY2c7a9yqG5LCt40IfV8S6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=skQjC4aVJEsB9h2Y/T5P2s9hHtbcd2V3cFzwR9By3TE=; b=pqI8B8c3WXkvAsFqLaPcI4ar9L8Q4HEESTeIznmovd4S/xF3w1YDLULUPoMlQxrJe6nshjVarf7x0mKzvDZghwj/KZM2h2NBJ+uvQzGjXIGomhRTJ4GP1ez8CnYJ2JHEqQOOQyFeFWqhUUxBtXgvZW45QeGzFysXcSy3ylqrky0= Received: from DM6PR11MB4073.namprd11.prod.outlook.com (2603:10b6:5:19f::22) by DM6PR11MB3065.namprd11.prod.outlook.com (2603:10b6:5:72::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.24; Tue, 15 Dec 2020 04:31:26 +0000 Received: from DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::c9f:47ea:6321:5ccb]) by DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::c9f:47ea:6321:5ccb%3]) with mapi id 15.20.3654.025; Tue, 15 Dec 2020 04:31:26 +0000 From: "Bob Feng" To: Yunhua Feng , "devel@edk2.groups.io" CC: Liming Gao , "Chen, Christine" Subject: Re: [PATCH] BaseTools/Scripts: Check for added newline at end of file Thread-Topic: [PATCH] BaseTools/Scripts: Check for added newline at end of file Thread-Index: AQHW0bCdJXiS/kxzjkOnZxOCGZowUqn3ka/A Date: Tue, 15 Dec 2020 04:31:26 +0000 Message-ID: References: <20201214003200.1252-1-fengyunhua@byosoft.com.cn> In-Reply-To: <20201214003200.1252-1-fengyunhua@byosoft.com.cn> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: byosoft.com.cn; dkim=none (message not signed) header.d=none;byosoft.com.cn; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.37] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d4c5aaf7-3ebf-4da2-00a6-08d8a0b248fa x-ms-traffictypediagnostic: DM6PR11MB3065: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4502; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PjtJjSGHlMSURxH8KlPMadMDdHuLGHOC1vXj3gEMp1d2Fu8jAQ6CuQHzprBGMQBie+s9oPUL+zgz9czjEBbP/dI1zbM9pSylSCt5wLmyEdVPxSVJ3XBe3T7w71C5Sbq238jE1Xlx10nCQcLppiXbWW7c9HaoOAHT3nMiwtpnpvqJ4DLvlOIMXLqvdMRoLUZB6jwvh1+Hkuemu0rVTi78Vd6IJ/Kuw6UB9WZBeahfYwCZDj69aHU/t11k03sUDjJ8+GcDxxLwUrVwfzzHifmTkZb8w7LcK3BwUwEgcSeXUQm0rHd19w4x3fdsypUxMOc8vE9FRInX0FM3WXmlEfdDSGKCZR8LbbXoHRwYB2Q6Bcs2pSxvUBf2ycL1Hip3ib56RBr8DJdzgaNqPIJ11DJdSg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4073.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(136003)(366004)(346002)(52536014)(107886003)(8936002)(55016002)(6506007)(110136005)(5660300002)(9686003)(83380400001)(54906003)(86362001)(66446008)(508600001)(66476007)(64756008)(66556008)(76116006)(66946007)(71200400001)(966005)(4326008)(26005)(7696005)(2906002)(53546011)(8676002)(186003)(33656002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?gqpUGMR3OfvQI3K8a7ilbjNhbTnIba5WsuK6yrbgcwLmzP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kMcdSNXQSzOr1C303iVpwNFeqw7IT8HP?= =?us-ascii?Q?AvPyF1ex8B+H3ZH3U66vQ8DkYix0JtbThRyAXr1IeCU=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4073.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4c5aaf7-3ebf-4da2-00a6-08d8a0b248fa X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Dec 2020 04:31:26.0732 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: mc90ykbuJaQk4iPuHHGiSibY31na6bVasM6MTO+VnnnnQAjXBALWyQn4SrYkko7hdtQV7+Uh5al/kdENNq9/4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3065 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Yunhua, I tested this patch. And I found if there are multiple files change in one= patch, your change can only detect the "new blank" error for the last file= . Thanks, Bob -----Original Message----- From: Yunhua Feng =20 Sent: Monday, December 14, 2020 8:32 AM To: devel@edk2.groups.io Cc: Feng, Bob C ; Liming Gao ; Chen, Christine Subject: [PATCH] BaseTools/Scripts: Check for added newline at end of file REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2685 Adding blank lines at end of file is bad enough practice that git complains= about it when importing patches (with git am): .git/rebase-apply/patch:105: new blank line at EOF. + warning: 1 line adds whitespace errors. Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Yunhua Feng --- BaseTools/Scripts/PatchCheck.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck= .py index 68c984ed0e..1859cdc580 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -316,6 +316,8 @@ class GitDiffCheck: self.new_bin =3D [] while self.line_num < self.count and self.format_ok: line_num =3D self.line_num + if line_num =3D=3D self.count - 1 and self.lines[line_num].str= ip() =3D=3D '+': + self.format_error('New blank line at EOF.') self.run() assert(self.line_num > line_num) self.report_message_result() -- 2.27.0.windows.1