<commit_before>#!/bin/bash

# Copyright 2015 Samsung Electronics Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

MAKE="$1"
shift

OUT_DIR="$1"
shift

TARGETS="$1"
shift

VERA_DIRECTORIES_EXCLUDE_LIST="-path ./third-party -o -path tests"
VERA_CONFIGURATION_PATH="./tools/vera++"

SOURCES_AND_HEADERS_LIST=`find . -type d \( $VERA_DIRECTORIES_EXCLUDE_LIST \) -prune -or -name "*.c" -or -name "*.cpp" -or -name "*.h"`
./tools/vera++/vera.sh -r $VERA_CONFIGURATION_PATH -p jerry $SOURCES_AND_HEADERS_LIST -e --no-duplicate
STATUS_CODE=$?

if [ $STATUS_CODE -ne 0 ]
then
 echo -e "\e[1;33m vera++ static checks failed. See output above for details. \e[0m\n"

 exit $STATUS_CODE
fi

echo -e "\nBuilding...\n\n"
$MAKE STATIC_CHECK=ON build || exit 1
echo -e "\n================ Build completed successfully. Running precommit tests ================\n"
echo -e "All targets were built successfully. Starting unit tests' run.\n"
$MAKE unittests_run || exit 1
echo -e "\nUnit tests completed successfully. Starting full testing.\n"

RUN_IDS=""
<commit_msg>Signed-off-by checker in precommit testing script.<commit_after>#!/bin/bash

# Copyright 2015 Samsung Electronics Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

MAKE="$1"
shift

OUT_DIR="$1"
shift

TARGETS="$1"
shift

# Checking presence and correctness of Signed-off-by message
commit_hash=`git show -s --format=%H HEAD`
author_name=`git show -s --format=%an HEAD`
author_email=`git show -s --format=%ae HEAD`
required_signed_off_by_line="JerryScript-DCO-1.0-Signed-off-by: $author_name $author_email"
actual_signed_off_by_line=`git show -s --format=%B HEAD | sed '/^$/d' | tail -n 1`

if [ "$actual_signed_off_by_line" != "$required_signed_off_by_line" ]
then
 echo -e "\e[1;33m Signed-off-by message is incorrect. The following line should be at the end of the $commit_hash commit's message: '$required_signed_off_by_line'. \e[0m\n"

 exit 1
fi

VERA_DIRECTORIES_EXCLUDE_LIST="-path ./third-party -o -path tests"
VERA_CONFIGURATION_PATH="./tools/vera++"

SOURCES_AND_HEADERS_LIST=`find . -type d \( $VERA_DIRECTORIES_EXCLUDE_LIST \) -prune -or -name "*.c" -or -name "*.cpp" -or -name "*.h"`
./tools/vera++/vera.sh -r $VERA_CONFIGURATION_PATH -p jerry $SOURCES_AND_HEADERS_LIST -e --no-duplicate
STATUS_CODE=$?

if [ $STATUS_CODE -ne 0 ]
then
 echo -e "\e[1;33m vera++ static checks failed. See output above for details. \e[0m\n"

 exit $STATUS_CODE
fi

echo -e "\nBuilding...\n\n"
$MAKE STATIC_CHECK=ON build || exit 1
echo -e "\n================ Build completed successfully. Running precommit tests ================\n"
echo -e "All targets were built successfully. Starting unit tests' run.\n"
$MAKE unittests_run || exit 1
echo -e "\nUnit tests completed successfully. Starting full testing.\n"

RUN_IDS=""

{'fraction_non_alphanumeric': 0.1350635593220339, 'fraction_numerical': 0.011652542372881356, 'mean_word_length': 4.327221438645981, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6467780', 'n_tokens_mistral': 1279, 'n_tokens_neox': 1209, 'n_words': 437}