Unverified Commit 31c2a2c6 authored by Kip's avatar Kip Committed by GitHub

Merge pull request #903 from Tachi107/meson-auto-clang-format

Remove custom format target in Meson
parents 6a073bd5 8805bdc9
......@@ -197,7 +197,7 @@ before_install:
# Check source code formatting
- if [ $TRAVIS_PULL_REQUEST != "false" ]; then changed_src=$(git diff --name-only master...HEAD | egrep "\.(h|cc)$" | grep -v "include/pistache/thirdparty" || [ $? == 1 ]); fi
- if [ ! -z "$changed_src" ]; then git-clang-format-10 --quiet --binary $(which clang-format-10) --diff master HEAD -- $changed_src > ./clang-format-diff; fi
- if [ -s ./clang-format-diff ]; then cat ./clang-format-diff && echo "Format source code according to .clang-format rules. Make sure to run make format" && false; fi
- if [ -s ./clang-format-diff ]; then cat ./clang-format-diff && echo "Format source code according to .clang-format rules. Make sure to run ninja clang-format" && false; fi
install:
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
......
......@@ -106,10 +106,3 @@ endif
if get_option('PISTACHE_BUILD_DOCS')
subdir('docs')
endif
if find_program('clang-format', required: false).found()
run_target(
'format',
command: (find_program('tools/format.sh'))
)
endif
......@@ -2,8 +2,6 @@
set -eu
if [ ! -z ${MESON_SOURCE_ROOT+x} ]; then cd "${MESON_SOURCE_ROOT}"; fi
find_files() {
git ls-files --cached --exclude-standard --others | grep -E '\.(cc|cpp|h)$'
}
......
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