mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
lint: Add linter to error on #include <*.cpp>
Files should depend on one another by interface, not by implementation. This checks for quoted includes as well. With practicalswift
This commit is contained in:
parent
a589f536b5
commit
9d6c9dbb88
1 changed files with 8 additions and 0 deletions
|
@ -33,6 +33,14 @@ for CPP_FILE in $(filter_suffix cpp); do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
INCLUDED_CPP_FILES=$(git grep -E "^#include [<\"][^>\"]+\.cpp[>\"]" -- "*.cpp" "*.h")
|
||||||
|
if [[ ${INCLUDED_CPP_FILES} != "" ]]; then
|
||||||
|
echo "The following files #include .cpp files:"
|
||||||
|
echo "${INCLUDED_CPP_FILES}"
|
||||||
|
echo
|
||||||
|
EXIT_CODE=1
|
||||||
|
fi
|
||||||
|
|
||||||
EXPECTED_BOOST_INCLUDES=(
|
EXPECTED_BOOST_INCLUDES=(
|
||||||
boost/algorithm/string.hpp
|
boost/algorithm/string.hpp
|
||||||
boost/algorithm/string/case_conv.hpp
|
boost/algorithm/string/case_conv.hpp
|
||||||
|
|
Loading…
Add table
Reference in a new issue