cryptonas-branches/translation-base-v0.3/bin/do_pylint.sh
lars 0a1a7bd383 started a seperate branch to manage translations for v0.3.x based on tags/v0.3.4.2
fixed corrupt language.hdf file for "volume_passwd" (merged from [891])
fixed spelling in "plugin_manager" and "volume_format_fs" (merged from [880])
merged current state of update_po_files.py (removed obsolete revert_unchanged.sh)
2007-03-29 19:04:21 +00:00

36 lines
715 B
Bash
Executable file

#!/bin/sh
#
# set some environmental variables for pylint and run it
#
PROJ_DIR=$(dirname "$0")/..
PROJ_DIR=$(cd "$PROJ_DIR"; pwd)
PYLINTRC=$PROJ_DIR/src/pylintrc
PYTHONPATH=$PROJ_DIR/src
function check_for_filename()
{
# maybe the argument is a file instead of a module name
if echo "$1" | grep -q "\.py$" && test -e "$1"
then local FILE_DIR=$(dirname "$1")
local MODULE=$(basename "${1%.py}")
ARGS="${ARGS} ${MODULE}"
PYTHONPATH="${PYTHONPATH}:${FILE_DIR}"
else ARGS="${ARGS} ${1}"
fi
}
while test $# -gt 0
do check_for_filename "$1"
shift
done
export PYTHONPATH
export PYLINTRC
[ ! -x /usr/bin/pylint ] && echo >&2 "please run \"apt-get install pylint\" first" && exit 1
pylint $ARGS