On 2019-12-19 06:12:56, Philippe Mathieu-Daudé wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=113
> 
> Strip the trailing characters before checking the subject line is
> less than 72 characters.
> 
> Fixes: e61406708c83f
> Cc: Liming Gao <liming....@intel.com>
> Cc: Jordan Justen <jordan.l.jus...@intel.com>
> Signed-off-by: Philippe Mathieu-Daude <phi...@redhat.com>
> ---
> Cc: Yonghong Zhu <yonghong....@intel.com>
> Cc: Zhichao Gao <zhichao....@intel.com>
> ---
>  BaseTools/Scripts/PatchCheck.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.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 >= 1 and len(lines[0]) >= 72:
> +        if count >= 1 and len(lines[0].strip()) >= 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 <jordan.l.jus...@intel.com>

>              self.error('First line of commit message (subject line) ' +
>                         'is too long.')
>
> -- 
> 2.21.0
> 
> 
> 
> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#52646): https://edk2.groups.io/g/devel/message/52646
Mute This Topic: https://groups.io/mt/68831576/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to