[Libreoffice-commits] core.git: bin/check-missing-unittests.py

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Tue Nov 3 12:44:44 UTC 2020


 bin/check-missing-unittests.py |   15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

New commits:
commit ebc527a6b2a1e935b5a870a5ca1d7f7eab84e0bc
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon Nov 2 16:27:10 2020 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue Nov 3 13:44:03 2020 +0100

    check-missing-unittests: use regex and simplify code
    
    Change-Id: Ica37de1adad0e97d1efd5f3f699d570af97ca90e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105188
    Tested-by: Xisco Fauli <xiscofauli at libreoffice.org>
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/bin/check-missing-unittests.py b/bin/check-missing-unittests.py
index cab6509fda93..901aa40cc82f 100755
--- a/bin/check-missing-unittests.py
+++ b/bin/check-missing-unittests.py
@@ -10,6 +10,7 @@ import os
 import datetime
 import subprocess
 import sys
+import re
 
 def main(ignoredBugs):
     results = {
@@ -50,7 +51,9 @@ def main(ignoredBugs):
         summary = commitInfo[0].strip('"').lower()
 
         #Check summary has a bug id
-        if 'tdf#' in summary or 'fdo#' in summary:
+        reBugId = re.search(r'(?<=tdf#|fdo#)\d{5,6}\b', summary)
+        if reBugId:
+            bugId = reBugId.group()
 
             isIgnored = False
             for i in ignoredBugs:
@@ -59,16 +62,6 @@ def main(ignoredBugs):
             if isIgnored:
                 continue
 
-            if 'tdf#' in summary:
-                if not summary.split('tdf#')[1][0].isdigit():
-                    continue
-                bugId = ''.join(filter(str.isdigit, summary.split('tdf#')[1].split(' ')[0]))
-            elif 'fdo#' in summary:
-                if not summary.split('fdo#')[1][0].isdigit():
-                    continue
-                bugId = ''.join(filter(str.isdigit, summary.split('fdo#')[1].split(' ')[0]))
-
-
             if bugId in hasTestSet:
                 continue
 


More information about the Libreoffice-commits mailing list