Skip to content

Commit 28fff06

Browse files
committed
test: Make linter to look for BOOST_ASSERT macros
The `BOOST_ASSERT` macro requires to `#include boost/assert.hpp`.
1 parent 47fe551 commit 28fff06

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/lint/lint-assertions.py

+10
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ def main():
4545
":(exclude)src/rpc/server.cpp",
4646
], "CHECK_NONFATAL(condition) or NONFATAL_UNREACHABLE should be used instead of assert for RPC code.")
4747

48+
# The `BOOST_ASSERT` macro requires to `#include boost/assert.hpp`,
49+
# which is an unnecessary Boost dependency.
50+
exit_code |= git_grep([
51+
"-E",
52+
r"BOOST_ASSERT *\(.*\);",
53+
"--",
54+
"*.cpp",
55+
"*.h",
56+
], "BOOST_ASSERT must be replaced with Assert, BOOST_REQUIRE, or BOOST_CHECK.")
57+
4858
sys.exit(exit_code)
4959

5060

0 commit comments

Comments
 (0)