Skip to content

Commit e36f802

Browse files
lint: add C++ code linter
This currently only checks for boost::bind usage. Co-authored-by: practicalswift <[email protected]>
1 parent c4be50f commit e36f802

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/lint/lint-cpp.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2020 The Bitcoin Core developers
4+
# Distributed under the MIT software license, see the accompanying
5+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
6+
#
7+
# Check for various C++ code patterns we want to avoid.
8+
9+
export LC_ALL=C
10+
11+
EXIT_CODE=0
12+
13+
OUTPUT=$(git grep -E "boost::bind\(" -- "*.cpp" "*.h")
14+
if [[ ${OUTPUT} != "" ]]; then
15+
echo "Use of boost::bind detected. Use std::bind instead."
16+
echo
17+
echo "${OUTPUT}"
18+
EXIT_CODE=1
19+
fi
20+
21+
exit ${EXIT_CODE}

0 commit comments

Comments
 (0)