Adapt precommit to run through all files

This commit is contained in:
jbajic 2022-03-02 17:22:37 +01:00 committed by János Benjamin Antal
parent 770ea1189a
commit 4f593c7fca
3 changed files with 11 additions and 6 deletions

View File

@ -16,6 +16,7 @@ tmpdir=$(mktemp -d repo-XXXXXXXX)
trap "rm -rf $tmpdir" EXIT INT
modified_files=$(git diff --cached --name-only --diff-filter=AM $against | sed -nE "/.*\.(cpp|cc|cxx|c|h|hpp)$/p")
FAIL=0
for file in $modified_files; do
echo "Checking $file..."
@ -25,17 +26,20 @@ for file in $modified_files; do
echo "Running clang-format..."
$project_folder/tools/git-clang-format $tmpdir/$file
code=$?
CODE=$?
if [ $code -ne 0 ]; then
if [ $CODE -ne 0 ]; then
break
fi
# Do not break header checker
echo "Running header checker..."
$project_folder/tools/header-checker.py $tmpdir/$file $file --amend-year
code=$?
# Do not break header checker
CODE=$?
if [ $CODE -ne 0 ]; then
FAIL=1
fi
done;
return $code
return $((CODE || FAIL))

View File

@ -99,6 +99,7 @@ ServerContext::ServerContext(const std::string &key_file, const std::string &cer
if (verify_peer) {
// Enable verification of the client certificate.
// NOLINTNEXTLINE(hicpp-signed-bitwise)
ctx_->set_verify_mode(boost::asio::ssl::verify_peer | boost::asio::ssl::verify_fail_if_no_peer_cert, ec);
MG_ASSERT(!ec, "Setting SSL verification mode failed!");
}

View File

@ -1000,4 +1000,4 @@ CPP-TYPE-DECL."
"object.member_ = member_;")
(single-member-test (member "UnknownClass")
"object.member_ = member_;")
(undefine-cpp-types))))
(undefine-cpp-types))))