enable .clang-format-ignore
We do have files that are imported as a whole, and clang-formatting them is a distraction. The requirement to add // clang-format-off to external files makes imports via scripts more difficult. This tweaks the build script to exclude files given in .clang-format-ignore from git-clang-format. The same naming convention is used by other projects.
This commit is contained in:
parent
12c622dfaa
commit
8edc5049cd
|
@ -16,7 +16,9 @@ jobs:
|
|||
install:
|
||||
script: |
|
||||
clang-format-7 --version
|
||||
git-clang-format-7 --binary clang-format-7 "${TRAVIS_BRANCH}"
|
||||
# build a pathspec that excludes the files in .clang-format-ignore
|
||||
while read file ; do echo EXCLUDES+="':(top,exclude)$file' " ; done < .clang-format-ignore
|
||||
git-clang-format-7 --binary clang-format-7 "${TRAVIS_BRANCH}" -- $EXCLUDES
|
||||
git diff > formatted.diff
|
||||
if [[ -s formatted.diff ]] ; then
|
||||
echo 'Formatting error! The following diff shows the required changes'
|
||||
|
|
Loading…
Reference in New Issue