summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-05-18 15:10:33 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-05-18 15:10:53 (GMT)
commit68be3618dc4cf444b6514a0797fde68c664b902f (patch)
tree8cc9ad740a032bbffb7d7c44e4146350ed56261c
parent4eea43fce72c0b9a08492b38c240f4c036e72a6d (diff)
parent8cfc45f6bd91b258eccf058913df1490ae2face6 (diff)
downloadCMake-68be3618dc4cf444b6514a0797fde68c664b902f.zip
CMake-68be3618dc4cf444b6514a0797fde68c664b902f.tar.gz
CMake-68be3618dc4cf444b6514a0797fde68c664b902f.tar.bz2
Merge topic 'clang-format-version'
8cfc45f6bd clang-format: Explicitly require version 3.8 of the tool Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2086
-rw-r--r--.clang-format2
-rwxr-xr-xUtilities/Scripts/clang-format.bash7
2 files changed, 7 insertions, 2 deletions
diff --git a/.clang-format b/.clang-format
index 88bfbd3..c0b5cc3 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,5 +1,5 @@
---
-# This configuration requires clang-format 3.8 or higher.
+# This configuration requires clang-format version 3.8 exactly.
BasedOnStyle: Mozilla
AlignOperands: false
AlwaysBreakAfterReturnType: None
diff --git a/Utilities/Scripts/clang-format.bash b/Utilities/Scripts/clang-format.bash
index 3b331a1..4c6225d 100755
--- a/Utilities/Scripts/clang-format.bash
+++ b/Utilities/Scripts/clang-format.bash
@@ -78,8 +78,8 @@ test "$#" = 0 || die "$usage"
# Find a default tool.
tools='
- clang-format
clang-format-3.8
+ clang-format
'
if test "x$clang_format" = "x"; then
for tool in $tools; do
@@ -96,6 +96,11 @@ if ! type -p "$clang_format" >/dev/null; then
exit 1
fi
+if ! "$clang_format" --version | grep 'clang-format version 3\.8' >/dev/null 2>/dev/null; then
+ echo "clang-format version 3.8 is required (exactly)"
+ exit 1
+fi
+
# Select listing mode.
case "$mode" in
'') echo "$usage"; exit 0 ;;