<commit_before>#!/bin/bash

directories="integration-tests ui-tests perf-tests dashboard reproducers load-tests db-integrity-tests taas job-checker baf e2e_tests_bot vscode-visual-tests a2t tools"
pass=0
fail=0

function prepare_venv() {
    VIRTUALENV="$(which virtualenv)"
    if [ $? -eq 1 ]; then
        # python36 which is in CentOS does not have virtualenv binary
        VIRTUALENV="$(which virtualenv-3)"
    fi
    if [ $? -eq 1 ]; then
        # still don't have virtual environment -> use python3.6 directly
        python3.6 -m venv venv && source venv/bin/activate && python3 "$(which pip3)" install pydocstyle
    else
        ${VIRTUALENV} -p python3 venv && source venv/bin/activate && python3 "$(which pip3)" install pydocstyle
    fi
}

# run the pydocstyle for all files that are provided in $1
function check_files() {
    for source in $1
    do
        echo "$source"
        pydocstyle --count "$source"
        if [ $? -eq 0 ]
        then
            echo "    Pass"
            let "pass++"<commit_msg>Update the script check-docstyle.sh to use directories.txt<commit_after>#!/bin/bash

IFS=$'\n'

# list of directories with sources to check
directories=$(cat directories.txt)

pass=0
fail=0

function prepare_venv() {
    VIRTUALENV="$(which virtualenv)"
    if [ $? -eq 1 ]; then
        # python36 which is in CentOS does not have virtualenv binary
        VIRTUALENV="$(which virtualenv-3)"
    fi
    if [ $? -eq 1 ]; then
        # still don't have virtual environment -> use python3.6 directly
        python3.6 -m venv venv && source venv/bin/activate && python3 "$(which pip3)" install pydocstyle
    else
        ${VIRTUALENV} -p python3 venv && source venv/bin/activate && python3 "$(which pip3)" install pydocstyle
    fi
}

# run the pydocstyle for all files that are provided in $1
function check_files() {
    for source in $1
    do
        echo "$source"
        pydocstyle --count "$source"
        if [ $? -eq 0 ]
        then
            echo "    Pass"
            let "pass++"
{'fraction_non_alphanumeric': 0.10864197530864197, 'fraction_numerical': 0.019753086419753086, 'mean_word_length': 2.541958041958042, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5957591', 'n_tokens_mistral': 663, 'n_tokens_neox': 618, 'n_words': 211}