From b9fdaf8a942ea2f79e48e3f735ba8916f3364e70 Mon Sep 17 00:00:00 2001 From: Bond-009 Date: Sun, 6 May 2018 19:07:34 +0200 Subject: Use clang-tidy to check more code conventions (#4214) * Create clang-tidy.sh * Add clang-tidy to circle.yml * Fixed some naming violations Fixes #4164 --- clang-tidy.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 clang-tidy.sh (limited to 'clang-tidy.sh') diff --git a/clang-tidy.sh b/clang-tidy.sh new file mode 100755 index 000000000..34cfb26e7 --- /dev/null +++ b/clang-tidy.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +FIXES_FILE="tidy-fixes.yaml" +REGEX="/cuberite/src/\.?[^\.]" +# TODO: Add -quiet when Circle CI is updated to 2.0 with a newer version of Ubuntu +ARGS="-header-filter $REGEX -export-fixes $FIXES_FILE "$@" $REGEX" + +mkdir -p tidy-build +cd tidy-build +cmake --target Cuberite -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. + +if run-clang-tidy.py $ARGS; then + echo "clang-tidy: No violations found" +else + echo "clang-tidy: Found violations" + exit 1 +fi -- cgit v1.2.3