Re: [libvirt PATCH v3 11/12] gitlab: introduce a check for validate DCO sign-off

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2020-03-26 at 12:35 +0000, Daniel P. Berrangé wrote:
[...]
> +for sha, subject in commits:
> +
> +    msg = subprocess.check_output(["git", "show", "-s", sha],
> +                                  universal_newlines=True)
> +    lines = msg.strip().split("\n")
> +
> +    print("🔍 %s %s" % (sha, subject))

I could personally live without the emoji...

> +    sob = False
> +    for line in lines:
> +        if "Signed-off-by:" in line:
> +            sob = True
> +            if "localhost" in line:
> +                print(" ❌ FAIL: bad email in %s" % line)
> +                errors = True

... but if you absolutely must have them, at least don't try to mess
with indentation - aligning text and emoji is basically never going
to work reliably anyway. Please consider applying the diff at the
end of this message if you think dropping the emoji is not an option.

Anyway, the rest looks good, so as long as you at least remove that
leading whitespace

  Reviewed-by: Andrea Bolognani <abologna@xxxxxxxxxx>


diff --git a/scripts/require-dco.py b/scripts/require-dco.py
index 3b642d6679..cb057e48b3 100755
--- a/scripts/require-dco.py
+++ b/scripts/require-dco.py
@@ -54,18 +54,20 @@ for sha, subject in commits:
                                   universal_newlines=True)
     lines = msg.strip().split("\n")

-    print("🔍 %s %s" % (sha, subject))
+    print("  %s %s " % (sha, subject), end="")
     sob = False
     for line in lines:
         if "Signed-off-by:" in line:
             sob = True
             if "localhost" in line:
-                print(" ❌ FAIL: bad email in %s" % line)
+                print("❌ (FAIL: bad email in %s)" % line)
                 errors = True

     if not sob:
-        print(" ❌ FAIL missing Signed-off-by tag")
+        print("❌ (FAIL: missing Signed-off-by tag)")
         errors = True
+    else:
+        print("✅")

 if errors:
     print("""
-- 
Andrea Bolognani / Red Hat / Virtualization





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux