[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] check-changes: Check bugfix version formatting



commit 7e862c3ec029d3cdfdd07483e31843c8f3b48a68
Author: teor <teor@xxxxxxxxxxxxxx>
Date:   Sat Sep 15 01:23:02 2018 +1000

    check-changes: Check bugfix version formatting
    
    Check that bugfix versions in changes files look like Tor versions
    from the versions spec.
    
    Part of ticket 27761.
---
 changes/ticket27761          | 3 +++
 scripts/maint/lintChanges.py | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/changes/ticket27761 b/changes/ticket27761
new file mode 100644
index 000000000..ef4686bdc
--- /dev/null
+++ b/changes/ticket27761
@@ -0,0 +1,3 @@
+  o Minor features (changelogs):
+    - Check that bugfix versions in changes files look like Tor versions
+      from the versions spec. Closes ticket 27761.
diff --git a/scripts/maint/lintChanges.py b/scripts/maint/lintChanges.py
index d5b8fcae5..5c5d45da1 100755
--- a/scripts/maint/lintChanges.py
+++ b/scripts/maint/lintChanges.py
@@ -87,6 +87,12 @@ def lintfile(fname):
             warn("Bugfix does not say 'Fixes bug X; bugfix on Y'")
         elif re.search('tor-([0-9]+)', contents):
             warn("Do not prefix versions with 'tor-'. ('0.1.2', not 'tor-0.1.2'.)")
+        else:
+            bugfix_match = re.search('bugfix on ([0-9]+\.[0-9]+\.[0-9]+)', contents)
+            if bugfix_match is None:
+                warn("Versions must have at least 3 digits. ('0.1.2', '0.3.4.8', or '0.3.5.1-alpha'.)")
+            elif bugfix_match.group(0) is None:
+                warn("Versions must have at least 3 digits. ('0.1.2', '0.3.4.8', or '0.3.5.1-alpha'.)")
 
     return have_warned != []
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits