summaryrefslogtreecommitdiff
path: root/Utilities/Scripts
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-05-31 13:40:34 -0400
committerBrad King <brad.king@kitware.com>2018-06-01 09:52:02 -0400
commit523c443d135f6474cf5a9d0372b3cc364fc7ebe5 (patch)
tree82f22000589d6ded60d2c325b221c5290cda3d3d /Utilities/Scripts
parenteb7ec19c1c639e91b812763ead3a56e97d20aec4 (diff)
downloadcmake-523c443d135f6474cf5a9d0372b3cc364fc7ebe5.tar.gz
clang-format.bash: update to clang-format-6.0
Update `.clang-format` with configuration to make the 6.0 format as close as possible to what 3.8 produced before. Then revise the style: * Indent preprocessor directives (a feature new since 3.8) * Add a newline and indentation before inheritance `:` and `,` Rename the Git attribute identifying the format to include the clang-format version number: `format.clang-format-6.0`. This will aid external infrastructure in knowing what version of the tool to run.
Diffstat (limited to 'Utilities/Scripts')
-rwxr-xr-xUtilities/Scripts/clang-format.bash10
1 files changed, 5 insertions, 5 deletions
diff --git a/Utilities/Scripts/clang-format.bash b/Utilities/Scripts/clang-format.bash
index 4c6225dfa8..7ca4433a81 100755
--- a/Utilities/Scripts/clang-format.bash
+++ b/Utilities/Scripts/clang-format.bash
@@ -78,7 +78,7 @@ test "$#" = 0 || die "$usage"
# Find a default tool.
tools='
- clang-format-3.8
+ clang-format-6.0
clang-format
'
if test "x$clang_format" = "x"; then
@@ -96,8 +96,8 @@ 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)"
+if ! "$clang_format" --version | grep 'clang-format version 6\.0' >/dev/null 2>/dev/null; then
+ echo "clang-format version 6.0 is required (exactly)"
exit 1
fi
@@ -115,8 +115,8 @@ esac
$git_ls |
# Select sources with our attribute.
- git check-attr --stdin format.clang-format |
- grep -e ': format\.clang-format: set$' |
+ git check-attr --stdin format.clang-format-6.0 |
+ grep -e ': format\.clang-format-6\.0: set$' |
sed -n 's/:[^:]*:[^:]*$//p' |
# Update sources in-place.