Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91895317
test_format.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 15, 13:22
Size
723 B
Mime Type
text/x-shellscript
Expires
Sun, Nov 17, 13:22 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22343208
Attached To
R9484 sp4e-homework-lars-bertil
test_format.sh
View Options
#!/bin/bash
echo "clang-format - checking Code Formatting..."
if [[ "${TRAVIS_OS_NAME}" == "linux" ]] && \
[[ "${TEST_CLANG_FORMAT}" == "yes" ]]; then
RETURN=0
CLANG_FORMAT="clang-format-3.9"
which clang-format-3.9
if [ ! -f ".clang-format" ]; then
echo ".clang-format file not found!"
exit 1
fi
FILES=`git diff master --name-only | grep -E "\.(cc|cpp|h)$"`
for FILE in $FILES; do
$CLANG_FORMAT $FILE | cmp $FILE >/dev/null
if [ $? -ne 0 ]; then
echo "[!] Clang-Format Found INCORRECT FORMATTING. Please re-format and re-submit. The following file failed: $FILE" >&2
RETURN=1
fi
done
exit $RETURN
fi
exit 0
Event Timeline
Log In to Comment