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
pull/585/head
Ben Woosley 7 years ago
parent a589f536b5
commit 9d6c9dbb88
No known key found for this signature in database
GPG Key ID: 4D8CA4BA18040906

@ -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

Loading…
Cancel
Save