clang-format: do not accept version above 19.x
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 22 Oct 2024 15:50:47 +0200
changeset 52062 73cf8b56c2f5
parent 52061 43e15277498e
child 52063 43602c675b4f
clang-format: do not accept version above 19.x This gives me different formatting on latest version available in Debian. So disabling for now.
tests/hghave.py
--- a/tests/hghave.py	Wed Oct 16 17:21:03 2024 +0200
+++ b/tests/hghave.py	Tue Oct 22 15:50:47 2024 +0200
@@ -624,12 +624,13 @@
     return matchoutput("pylint --help", br"[Uu]sage:[ ]+pylint", True)
 
 
-@check("clang-format", "clang-format C code formatter (>= 11)")
+@check("clang-format", "clang-format C code formatter (11 <= … < 19)")
 def has_clang_format():
     m = matchoutput('clang-format --version', br'clang-format version (\d+)')
-    # style changed somewhere between 10.x and 11.x
+    # style changed somewhere between 10.x and 11.x and after 19.
     if m:
-        return int(m.group(1)) >= 11
+        major_version = int(m.group(1))
+        return 11 <= major_version < 19
     # Assist Googler contributors, they have a centrally-maintained version of
     # clang-format that is generally very fresh, but unlike most builds (both
     # official and unofficial), it does *not* include a version number.