<commit_before>#### Description: generates summary report :)
## Params:
# b – branch name
# p - project name
# h - commit hash
# m - commit message
# v - bundle version

# properties support : )
PROPERTY_FILE="reports/reports.properties"
function getProperty {
   PROP_KEY=$1
   PROP_VALUE=`cat $PROPERTY_FILE | grep "$PROP_KEY" | cut -d'=' -f2`
   echo $PROP_VALUE
}

# parse parameters
while getopts "b:p:h:m:v:" option; do
    case "${option}" in
        b) BRANCH_NAME=${OPTARG};;
        p) PROJECT_NAME=${OPTARG};;
        h) COMMIT_HASH=${OPTARG};;
        m) COMMIT_MESSAGE=${OPTARG};;
        v) BUNDLE_VERSION=${OPTARG};;
    esac
done

# summary configuration
# SOME=$(getProperty "TAILOR_STATIC_FOLDER")
# echo $SOME

JSON="{\"branch\":\"$BRANCH_NAME\",\
\"project_name\":\"$PROJECT_NAME\",\
\"commit_hash\":\"$COMMIT_HASH\",\
\"commit_message\":\"$COMMIT_MESSAGE\",\
\"bundle_version\":\"$BUNDLE_VERSION\",\
\"reports\":[{\
\"type\":\"clang\",\
\"report_json\":\"/$(getProperty "CLANG_JSON_SUMMARY_FOLDER")/report.json\",\
\"report_html\":\"/clang/index.html\",\
\"summary\":\"summary\"\
},{\
\"type\":\"jscpd\",\
\"report_json\":\"/$(getProperty "JSCPD_JSON_SUMMARY_FOLDER")/report.json\",\
\"report_html\":\"/jscpd/index.html\",\
\"summary\":\"statistics\"\
}]\
}"

# echo $JSON

# TODO: get `ci` folder from parameter
python ci/reports/scripts/summary.py $JSON

cp -rf ci/reports/index.html ci_report/
cp -rf ci/reports/static ci_report/<commit_msg>quick fix<commit_after>#### Description: generates summary report :)
## Params:
# b – branch name
# p - project name
# h - commit hash
# m - commit message
# v - bundle version

# properties support : )
PROPERTY_FILE="reports/reports.properties"
function getProperty {
   PROP_KEY=$1
   PROP_VALUE=`cat $PROPERTY_FILE | grep "$PROP_KEY" | cut -d'=' -f2`
   echo $PROP_VALUE
}

# parse parameters
while getopts "b:p:h:m:v:" option; do
    case "${option}" in
        b) BRANCH_NAME=${OPTARG};;
        p) PROJECT_NAME=${OPTARG};;
        h) COMMIT_HASH=${OPTARG};;
        m) COMMIT_MESSAGE=${OPTARG};;
        v) BUNDLE_VERSION=${OPTARG};;
    esac
done

# summary configuration
# SOME=$(getProperty "TAILOR_STATIC_FOLDER")
# echo $SOME

JSON="{\"branch\":\"$BRANCH_NAME\",\
\"project_name\":\"$PROJECT_NAME\",\
\"commit_hash\":\"$COMMIT_HASH\",\
\"commit_message\":\"$COMMIT_MESSAGE\",\
\"bundle_version\":\"$BUNDLE_VERSION\",\
\"reports\":[{\
\"type\":\"clang\",\
\"report_json\":\"/$(getProperty "CLANG_JSON_SUMMARY_FOLDER")/report.json\",\
\"report_html\":\"/clang/index.html\",\
\"summary\":\"summary\"\
},{\
\"type\":\"jscpd\",\
\"report_json\":\"/$(getProperty "JSCPD_JSON_SUMMARY_FOLDER")/report.json\",\
\"report_html\":\"/jscpd/index.html\",\
\"summary\":\"statistics\"\
}]\
}"

# echo $JSON

# TODO: sazha, fix me!
mkdir -p ci_report/json

# TODO: get `ci` folder from parameter
python ci/reports/scripts/summary.py $JSON

cp -rf ci/reports/index.html ci_report/
cp -rf ci/reports/static ci_report/
{'fraction_non_alphanumeric': 0.21519838601210492, 'fraction_numerical': 0.0013449899125756557, 'mean_word_length': 3.96661101836394, 'pattern_counts': {'":': 28, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2343324', 'n_tokens_mistral': 1106, 'n_tokens_neox': 1082, 'n_words': 207}