From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: michael.d.kinney@intel.com) Received: from mga01.intel.com (mga01.intel.com []) by groups.io with SMTP; Thu, 01 Aug 2019 17:13:17 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Aug 2019 17:13:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,336,1559545200"; d="scan'208";a="372796688" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.251.130.221]) by fmsmga006.fm.intel.com with ESMTP; 01 Aug 2019 17:13:17 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Jordan Justen Subject: [Patch 1/3] BaseTools/PatchCheck: Ignore blank lines in diff Date: Thu, 1 Aug 2019 17:13:12 -0700 Message-Id: <20190802001314.25980-2-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20190802001314.25980-1-michael.d.kinney@intel.com> References: <20190802001314.25980-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit https://bugzilla.tianocore.org/show_bug.cgi?id=2044 When fixes are made for incorrect line endings, there are cases where the diff contains blank lines. Ignore these blank lines. Cc: Bob Feng Cc: Liming Gao Cc: Jordan Justen Signed-off-by: Michael D Kinney --- BaseTools/Scripts/PatchCheck.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py index 6aec15d0f0..4f2ef81ae7 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -270,6 +270,7 @@ class GitDiffCheck: if line.startswith('@@ '): self.state = PRE_PATCH elif len(line) >= 1 and line[0] not in ' -+' and \ + not line.startswith('\r\n') and \ not line.startswith(r'\ No newline ') and not self.binary: for line in self.lines[self.line_num + 1:]: if line.startswith('diff --git'): @@ -313,6 +314,8 @@ class GitDiffCheck: pass elif line.startswith('+'): self.check_added_line(line[1:]) + elif line.startswith('\r\n'): + pass elif line.startswith(r'\ No newline '): pass elif not line.startswith(' '): -- 2.21.0.windows.1