Patchwork [2,of,2] hghave: require clang-format >= 6 due to output change

login
register
mail settings
Submitter Yuya Nishihara
Date July 14, 2018, 2:02 a.m.
Message ID <d5b851a39710f8415f98.1531533774@mimosa>
Download mbox | patch
Permalink /patch/32840/
State Accepted
Headers show

Comments

Yuya Nishihara - July 14, 2018, 2:02 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1531533112 -32400
#      Sat Jul 14 10:51:52 2018 +0900
# Node ID d5b851a39710f8415f98575e4f00396fe7ee2809
# Parent  42bce1d7778658cae95ec0a2aa29ff72d503c000
hghave: require clang-format >= 6 due to output change
Augie Fackler - July 16, 2018, 5:22 p.m.
On Sat, Jul 14, 2018 at 11:02:54AM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1531533112 -32400
> #      Sat Jul 14 10:51:52 2018 +0900
> # Node ID d5b851a39710f8415f98575e4f00396fe7ee2809
> # Parent  42bce1d7778658cae95ec0a2aa29ff72d503c000
> hghave: require clang-format >= 6 due to output change

queued, thanks

I kept meaning to do this, but forgetting.

Patch

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -452,8 +452,9 @@  def has_pylint():
 
 @check("clang-format", "clang-format C code formatter")
 def has_clang_format():
-    return matchoutput("clang-format --help",
-                       br"^OVERVIEW: A tool to format C/C\+\+[^ ]+ code.")
+    m = matchoutput('clang-format --version', br'clang-format version (\d)')
+    # style changed somewhere between 4.x and 6.x
+    return m and int(m.group(1)) >= 6
 
 @check("jshint", "JSHint static code analysis tool")
 def has_jshint():