From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web10.9558.1577957999915385905 for ; Thu, 02 Jan 2020 01:40:00 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: jordan.l.justen@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2020 01:39:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,386,1571727600"; d="scan'208";a="419687733" Received: from kdejong-mobl1.amr.corp.intel.com (HELO localhost) ([10.252.133.68]) by fmsmga005.fm.intel.com with ESMTP; 02 Jan 2020 01:39:58 -0800 MIME-Version: 1.0 In-Reply-To: <20191219141256.25752-1-philmd@redhat.com> References: <20191219141256.25752-1-philmd@redhat.com> To: Philippe Mathieu-Daudé , devel@edk2.groups.io Cc: Philippe Mathieu-Daude , Liming Gao , Yonghong Zhu , Zhichao Gao Subject: Re: [edk2-devel] [PATCH 1/1] BaseTools/PatchCheck.py: Ignore CR and LF characters in subject length From: "Jordan Justen" Message-ID: <157795799839.2404955.6192927022904181653@jljusten-skl> User-Agent: alot/0.8 Date: Thu, 02 Jan 2020 01:39:58 -0800 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 2019-12-19 06:12:56, Philippe Mathieu-Daud=C3=A9 wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D113 >=20 > Strip the trailing characters before checking the subject line is > less than 72 characters. >=20 > Fixes: e61406708c83f > Cc: Liming Gao > Cc: Jordan Justen > Signed-off-by: Philippe Mathieu-Daude > --- > Cc: Yonghong Zhu > Cc: Zhichao Gao > --- > BaseTools/Scripts/PatchCheck.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCh= eck.py > index 2a4e6f603e79..b72e71963ea8 100755 > --- a/BaseTools/Scripts/PatchCheck.py > +++ b/BaseTools/Scripts/PatchCheck.py > @@ -196,7 +196,7 @@ class CommitMessageCheck: > self.error('Empty commit message!') > return > > - if count >=3D 1 and len(lines[0]) >=3D 72: > + if count >=3D 1 and len(lines[0].strip()) >=3D 72: I think we should use rstrip rather than strip. I tried to test this with rstrip instead, by updating the commit message to have several whitespace characters at the beginning. Unfortunately, I think subject_prefix_re is eating more spaces at the start of the line than it ought to. The leading whitespace issue is probably a problem for another day, so if you change it to rstrip, then: Reviewed-by: Jordan Justen > self.error('First line of commit message (subject line) ' + > 'is too long.') > > --=20 > 2.21.0 >=20 >=20 >=20 >=20