#!/bin/bash
# This file is part of curtin. See LICENSE file for copyright and license info.

PYTHON_VERSION=${PYTHON_VERSION:-2}
CR="
"
vmtests=""
if [ "$PYTHON_VERSION" = "3" ]; then
    vmtests="tests/vmtests/"
fi
pycheck_dirs=(
    "curtin/"
    "tests/unittests/"
    $vmtests
    "tools/curtin-log-print"
    "tools/report_webhook_logger"
)

set -f
if [ $# -eq 0 ]; then
   files=( "${pycheck_dirs[@]}" )
else
   files=( "$@" )
fi

cmd=( "python${PYTHON_VERSION}" -m "pyflakes" "${files[@]}" )

echo "Running: " "${cmd[@]}" 1>&2
exec "${cmd[@]}"

# vi: ts=4 expandtab syntax=sh
