Skip to content

Commit f912430

Browse files
committed
Run clang-format with make check
1 parent a8f5fa5 commit f912430

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ stamp-h1
3333
*.exe
3434
.idea
3535
cmake-build-debug/
36+
*.log
37+
*.trs

.travis.yml

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

Makefile.am

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ dvi:
88

99
pkgconfigdir = $(libdir)/pkgconfig
1010
pkgconfig_DATA = jansson.pc
11+
12+
TESTS = scripts/clang-format-check

scripts/clang-format-ci scripts/clang-format-check

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ if [ -n "$1" ]; then
55
clangformat="clang-format-$1"
66
fi
77

8+
if ! type $clangformat >/dev/null; then
9+
# clang-format not found. If running tests, mark this test as
10+
# skipped.
11+
exit 77
12+
fi
13+
814
errors=0
915
paths=$(find . -type f -a '(' -name '*.c' -o -name '*.h' ')')
1016
for path in $paths; do

test/.gitignore

-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,3 @@ suites/api/test_simple
1818
suites/api/test_sprintf
1919
suites/api/test_unpack
2020
suites/api/test_version
21-
run-suites.log
22-
run-suites.trs
23-
test-suite.log
24-

0 commit comments

Comments
 (0)