2018-06-20 11:54:54 +02:00
|
|
|
#!/usr/bin/env bash
|
2018-04-05 16:18:26 +02:00
|
|
|
#
|
|
|
|
# Copyright (c) 2018 The Bitcoin Core developers
|
|
|
|
# Distributed under the MIT software license, see the accompanying
|
|
|
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#
|
|
|
|
# Check that all logs are terminated with '\n'
|
|
|
|
#
|
|
|
|
# Some logs are continued over multiple lines. They should be explicitly
|
|
|
|
# commented with \* Continued *\
|
|
|
|
#
|
|
|
|
# There are some instances of LogPrintf() in comments. Those can be
|
|
|
|
# ignored
|
|
|
|
|
2018-06-13 16:50:48 +02:00
|
|
|
export LC_ALL=C
|
2018-05-02 15:12:18 +02:00
|
|
|
UNTERMINATED_LOGS=$(git grep --extended-regexp "LogPrintf?\(" -- "*.cpp" | \
|
2018-04-05 16:18:26 +02:00
|
|
|
grep -v '\\n"' | \
|
|
|
|
grep -v "/\* Continued \*/" | \
|
2018-05-02 15:12:18 +02:00
|
|
|
grep -v "LogPrint()" | \
|
2018-04-05 16:18:26 +02:00
|
|
|
grep -v "LogPrintf()")
|
|
|
|
if [[ ${UNTERMINATED_LOGS} != "" ]]; then
|
2018-05-02 15:12:18 +02:00
|
|
|
echo "All calls to LogPrintf() and LogPrint() should be terminated with \\n"
|
2018-04-05 16:18:26 +02:00
|
|
|
echo
|
|
|
|
echo "${UNTERMINATED_LOGS}"
|
|
|
|
exit 1
|
|
|
|
fi
|