Commit b236092d authored by 4ast's avatar 4ast

Merge pull request #496 from iovisor/bblanco_dev

Add infra and ctest for code style formatting
parents 49d2ca8c d3d2a573
---
BasedOnStyle: Google
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
This diff is collapsed.
#!/bin/bash
# Runs clang-format on the files changed between HEAD and $1, which defaults to
# origin/master.
# to pick up git-clang-format from scripts/
export PATH=$(dirname $0):$PATH
CLANG_FORMAT=${CLANG_FORMAT:-clang-format}
GITREF=${1:-origin/master}
if ! hash $CLANG_FORMAT 2> /dev/null; then
echo "Could not find clang-format tool" 1>&2
exit 1
fi
cmd="git clang-format $GITREF --binary $CLANG_FORMAT --diff --extensions h,c,cc"
n=$($cmd --quiet | wc -l)
if [ $n -gt 0 ]; then
$cmd -v
exit 1
fi
...@@ -4,6 +4,8 @@ configure_file(wrapper.sh.in "${CMAKE_CURRENT_BINARY_DIR}/wrapper.sh" @ONLY) ...@@ -4,6 +4,8 @@ configure_file(wrapper.sh.in "${CMAKE_CURRENT_BINARY_DIR}/wrapper.sh" @ONLY)
set(TEST_WRAPPER ${CMAKE_CURRENT_BINARY_DIR}/wrapper.sh) set(TEST_WRAPPER ${CMAKE_CURRENT_BINARY_DIR}/wrapper.sh)
add_test(NAME style-check COMMAND ${CMAKE_SOURCE_DIR}/scripts/style-check.sh)
add_subdirectory(cc) add_subdirectory(cc)
add_subdirectory(python) add_subdirectory(python)
add_subdirectory(lua) add_subdirectory(lua)
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