HEX
Server: Apache
System: Linux server.inglory.de 5.15.0-139-generic #149~20.04.1-Ubuntu SMP Wed Apr 16 08:29:56 UTC 2025 x86_64
User: inglory.de_9f9idjkoa1i (10000)
PHP: 8.3.30
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/inglory.de/seafile/seafile-server-10.0.1/seahub/code-check.sh
#!/bin/bash
#
#
#

function usage() {
    echo
    echo "    Seahub project code checker."
    echo
    echo "    It runs pylint on the code and prints the result."
    echo
    echo "    To check a file:"
    echo
    echo "      ./code-check.sh seahub.views.file"
    echo
    echo "    To check a module:"
    echo
    echo "      ./code-check.sh seahub.views"
    echo
}

if [[ $# == 0 ]]; then
    usage;
    exit 1
fi

if [[ $# == 1 ]]; then
    if [[ $1 == "-h" || $1 == "--help" ]]; then
        usage;
        exit 1
    fi
fi

SCRIPT=$(readlink -f "$0")
PROJECT_DIR=$(dirname "${SCRIPT}")

cd ${PROJECT_DIR}

if ! which pylint 2>/dev/null 1>&2; then
    echo
    echo "Pylint not found. Please install it first by:"
    echo
    echo "      sudo pip install pylint"
    echo
    exit 1
fi

pylintrc=${PROJECT_DIR}/pylintrc
if ! [[ -f ${pylintrc} ]]; then
    echo "${pylintrc} not found"
    echo 
    echo "mv pylintrc.template pylintrc"
    echo
    
    exit 1
fi

pylint --rcfile=${pylintrc} -E $@