Merge #13301: lint: Add linter to error on #include <*.cpp>
9d6c9dbb88
lint: Add linter to error on #include <*.cpp> (Ben Woosley)
Pull request description:
Files should depend on one another by interface, not by implementation.
This checks for quoted includes as well.
Tree-SHA512: d36d468f48d538077f5f927b9561729fd7d76319f6b2e2cc10414a9f243588194e90ca1d85eca65019f9259268f555d25106eaaa56da28c58fa8d5837b469661
This commit is contained in:
commit
e4082d59f5
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…
Reference in a new issue