Commit 0a62b768 authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'clang-format-kwsys'

34ab6f2e clang-format-kwsys: Update to version 6.0
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !12
parents 85c4f079 34ab6f2e
#!/bin/sh
# This formatter is meant specifically for the KWSys project.
# It performs special filtering before and after running
# `clang-format-3.8` in order to protect `@KWSYS_NAMESPACE@`
# `clang-format-6.0` in order to protect `@KWSYS_NAMESPACE@`
# and other placholders using `@`.
#
# This formatter uses the `clang-format-3.8` tool to perform
# This formatter uses the `clang-format-6.0` tool to perform
# formatting of files written in C, C++, and other C-like
# languages (CUDA, GLSL, etc.).
#
# It uses the `clang-format-3.8` executable in `$PATH` and checks for
# It uses the `clang-format-6.0` executable in `$PATH` and checks for
# the existence of the `.clang-format` file as its configuration.
set -e
......@@ -21,8 +21,8 @@ if ! [ -f "$path" ]; then
exit 4
fi
if ! which "clang-format-3.8" > /dev/null; then
echo >&2 'error: could not find the `clang-format-3.8` binary'
if ! which "clang-format-6.0" > /dev/null; then
echo >&2 'error: could not find the `clang-format-6.0` binary'
exit 3
fi
......@@ -35,7 +35,7 @@ fi
# clang-format can understand the symbols and preserve lengths.
sed -i 's/@\(KWSYS_[A-Z0-9_]\+\)@/x\1x/g' "$path"
clang-format-3.8 -i "$path"
clang-format-6.0 -i "$path"
# Restore the original `@KWSYS_...@` placeholders.
sed -i 's/x\(KWSYS_[A-Z0-9_]\+\)x/@\1@/g' "$path"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment