Files
OpenSK/github_actions/pylint/entrypoint.sh
Jean-Michel Picod 47c523e959 Fix entrypoint
2020-02-27 20:11:29 +01:00

33 lines
684 B
Bash

#!/bin/bash
env
PYLINT_CMD="pylint --score=n${INPUT_CONFIG_FILE:+ --rcfile=${INPUT_CONFIG_FILE}}"
EXCLUDE_PATH=${INPUT_EXCLUDE_PATH:-}
EXCLUDE_FILES=${INPUT_EXCLUDE_PATH:-}
SUCCESS=0
for file in ${FILES}
do
fname=$(basename $file)
directory=$(dirname $file)
if [[ "$directory" =~ "^${EXCLUDE_PATH}" ]]
then
echo "Ignoring file '$file' (reason: matching exclude-path parameter)"
continue
fi
if [[ "$fname" =~ "${EXCLUDE_FILES}" ]]
then
echo "Ignoring file '$file' (reason: matching exclude-files parameter)"
continue
fi
# Just to trigger the custom matcher
echo PYLINT:$file
if ! $PYLINT_CMD $file
then
SUCCESS=1
fi
done
exit $SUCCESS