Run clang-format with make check

This commit is contained in:
Petri Lehtinen 2019-10-19 20:46:34 +03:00
parent a8f5fa5f5a
commit f912430cda
5 changed files with 11 additions and 5 deletions

2
.gitignore vendored
View File

@ -33,3 +33,5 @@ stamp-h1
*.exe
.idea
cmake-build-debug/
*.log
*.trs

View File

@ -29,4 +29,4 @@ script:
- if [ "$JANSSON_BUILD_METHOD" = "cmake" ]; then mkdir build && cd build && cmake $JANSSON_CMAKE_OPTIONS .. && cmake --build . && ctest --output-on-failure; fi
- if [ "$JANSSON_BUILD_METHOD" = "coverage" ]; then mkdir build && cd build && cmake $JANSSON_CMAKE_OPTIONS .. && cmake --build . && cmake --build . --target coveralls; fi
- if [ "$JANSSON_BUILD_METHOD" = "fuzzer" ]; then ./test/ossfuzz/travisoss.sh; fi
- if [ "$JANSSON_BUILD_METHOD" = "lint" ]; then ./scripts/clang-format-ci 9; fi
- if [ "$JANSSON_BUILD_METHOD" = "lint" ]; then ./scripts/clang-format-check 9; fi

View File

@ -8,3 +8,5 @@ dvi:
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = jansson.pc
TESTS = scripts/clang-format-check

View File

@ -5,6 +5,12 @@ if [ -n "$1" ]; then
clangformat="clang-format-$1"
fi
if ! type $clangformat >/dev/null; then
# clang-format not found. If running tests, mark this test as
# skipped.
exit 77
fi
errors=0
paths=$(find . -type f -a '(' -name '*.c' -o -name '*.h' ')')
for path in $paths; do

4
test/.gitignore vendored
View File

@ -18,7 +18,3 @@ suites/api/test_simple
suites/api/test_sprintf
suites/api/test_unpack
suites/api/test_version
run-suites.log
run-suites.trs
test-suite.log