From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web09.7762.1608016103039417937 for ; Mon, 14 Dec 2020 23:08:24 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: fengyunhua@byosoft.com.cn) Received: from LAPTOP2AECFQIA ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Tue, 15 Dec 2020 15:08:15 +0800 X-WM-Sender: fengyunhua@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: fengyunhua@byosoft.com.cn From: "fengyunhua" To: "'Feng, Bob C'" , Cc: "'Liming Gao'" , "'Chen, Christine'" References: <20201214003200.1252-1-fengyunhua@byosoft.com.cn> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbUEFUQ0hdIEJhc2VUb29scy9TY3JpcHRzOiBDaGVjayBmb3IgYWRkZWQgbmV3bGluZSBhdCBlbmQgb2YgZmlsZQ==?= Date: Tue, 15 Dec 2020 15:08:17 +0800 Message-ID: <000201d6d2b1$10031490$30093db0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJDW/QaevphCqsV1GShDwC5Wtj8OgKT1YjJqQoLSpA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Hi Bob, I will update this patch. Thanks, Yunhua -----=D3=CA=BC=FE=D4=AD=BC=FE----- =B7=A2=BC=FE=C8=CB: Feng, Bob C =20 =B7=A2=CB=CD=CA=B1=BC=E4: 2020=C4=EA12=D4=C215=C8=D5 12:31 =CA=D5=BC=FE=C8=CB: Yunhua Feng ; = devel@edk2.groups.io =B3=AD=CB=CD: Liming Gao ; Chen, Christine =D6=F7=CC=E2: RE: [PATCH] BaseTools/Scripts: Check for added newline at = end of file 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].strip() =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