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:
Ben Woosley 2018-05-21 20:20:24 -07:00
parent a589f536b5
commit 9d6c9dbb88
No known key found for this signature in database
GPG Key ID: 4D8CA4BA18040906

View File

@ -33,6 +33,14 @@ for CPP_FILE in $(filter_suffix cpp); do
fi
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=(
boost/algorithm/string.hpp
boost/algorithm/string/case_conv.hpp