From bcd4b0f5cdde2a1b562a612c78ec1ef1fe47d3dd Mon Sep 17 00:00:00 2001 From: practicalswift Date: Tue, 7 Aug 2018 14:57:54 +0200 Subject: [PATCH] Add linting of WalletLogPrintf(...) format strings --- test/lint/lint-format-strings.py | 2 ++ test/lint/lint-format-strings.sh | 1 + 2 files changed, 3 insertions(+) diff --git a/test/lint/lint-format-strings.py b/test/lint/lint-format-strings.py index dcdd1dcf7..c07dfe317 100755 --- a/test/lint/lint-format-strings.py +++ b/test/lint/lint-format-strings.py @@ -18,6 +18,8 @@ FALSE_POSITIVES = [ ("src/netbase.cpp", "LogConnectFailure(bool manual_connection, const char* fmt, const Args&... args)"), ("src/util.cpp", "strprintf(_(COPYRIGHT_HOLDERS), _(COPYRIGHT_HOLDERS_SUBSTITUTION))"), ("src/util.cpp", "strprintf(COPYRIGHT_HOLDERS, COPYRIGHT_HOLDERS_SUBSTITUTION)"), + ("src/wallet/wallet.h", "WalletLogPrintf(std::string fmt, Params... parameters)"), + ("src/wallet/wallet.h", "LogPrintf((\"%s \" + fmt).c_str(), GetDisplayName(), parameters...)"), ] diff --git a/test/lint/lint-format-strings.sh b/test/lint/lint-format-strings.sh index c4041d4b3..17f846d29 100755 --- a/test/lint/lint-format-strings.sh +++ b/test/lint/lint-format-strings.sh @@ -24,6 +24,7 @@ FUNCTION_NAMES_AND_NUMBER_OF_LEADING_ARGUMENTS=( vprintf,1 vsnprintf,1 vsprintf,1 + WalletLogPrintf,0 ) EXIT_CODE=0