Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Run clang-format with make check
  • Loading branch information
akheron committed Oct 21, 2019
1 parent a8f5fa5 commit f912430
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -33,3 +33,5 @@ stamp-h1
*.exe
.idea
cmake-build-debug/
*.log
*.trs
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -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
2 changes: 2 additions & 0 deletions Makefile.am
Expand Up @@ -8,3 +8,5 @@ dvi:

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = jansson.pc

TESTS = scripts/clang-format-check
6 changes: 6 additions & 0 deletions scripts/clang-format-ci → scripts/clang-format-check
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions test/.gitignore
Expand Up @@ -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

0 comments on commit f912430

Please sign in to comment.