瀏覽代碼

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.
teor 5 年之前
父節點
當前提交
7e862c3ec0
共有 2 個文件被更改,包括 9 次插入0 次删除
  1. 3 0
      changes/ticket27761
  2. 6 0
      scripts/maint/lintChanges.py

+ 3 - 0
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.

+ 6 - 0
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 != []