Skip to content

Commit

Permalink
test: Make linter to look for BOOST_ASSERT macros
Browse files Browse the repository at this point in the history
The `BOOST_ASSERT` macro requires to `#include boost/assert.hpp`.
  • Loading branch information
hebasto committed Jun 14, 2023
1 parent 47fe551 commit de5e464
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/lint/lint-assertions.py
Expand Up @@ -45,6 +45,16 @@ def main():
":(exclude)src/rpc/server.cpp",
], "CHECK_NONFATAL(condition) or NONFATAL_UNREACHABLE should be used instead of assert for RPC code.")

# The `BOOST_ASSERT` macro requires to `#include boost/assert.hpp`,
# which is an unnecessary Boost dependency.
exit_code |= git_grep([
"-E",
r"BOOST_ASSERT *\(.*\);",
"--",
"*.cpp",
"*.h",
], "BOOST_ASSERT must replaced with non-Boost alternatives.")

sys.exit(exit_code)


Expand Down

0 comments on commit de5e464

Please sign in to comment.