Fix signed-off check in tolerant mode (#3915)

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2020-06-18 13:04:46 +02:00
committed by GitHub
parent 5e34a5e978
commit fb6ea035d3
3 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
- name: Initializtaion - name: Initializtaion
run: sudo apt-get install doxygen vera++ cppcheck pylint pylint python-serial -q run: sudo apt-get install doxygen vera++ cppcheck pylint pylint python-serial -q
- name: Signed-off - name: Signed-off
run: $RUNNER --check-signed-off=travis run: $RUNNER --check-signed-off=gh-actions
- name: Doxygen - name: Doxygen
run: $RUNNER --check-doxygen run: $RUNNER --check-doxygen
- name: Vera++ - name: Vera++
+8 -8
View File
@@ -17,7 +17,7 @@
# Usage # Usage
function print_usage function print_usage
{ {
echo "Usage: $0 [--help] [--tolerant] [--travis]" echo "Usage: $0 [--help] [--tolerant] [--gh-actions]"
} }
function print_help function print_help
@@ -31,7 +31,7 @@ function print_help
echo " --tolerant check the existence of the message only but don't" echo " --tolerant check the existence of the message only but don't"
echo " require the name and email address to match the author" echo " require the name and email address to match the author"
echo " of the commit" echo " of the commit"
echo " --travis perform check in tolerant mode if on Travis CI and not" echo " --gh-actions perform check in tolerant mode if on GitHub-Actions and not"
echo " checking a pull request, perform strict check otherwise" echo " checking a pull request, perform strict check otherwise"
echo "" echo ""
echo "The last line of every commit message must follow the form of:" echo "The last line of every commit message must follow the form of:"
@@ -52,16 +52,16 @@ do
then then
TOLERANT="yes" TOLERANT="yes"
shift shift
elif [ "$1" == "--travis" ] elif [ "$1" == "--gh-actions" ]
then then
if [ "$TRAVIS_PULL_REQUEST" == "" ] if [ "$GITHUB_EVENT_NAME" == "" ]
then then
echo -e "\e[1;33mWarning! Travis-tolerant mode requested but not running on Travis CI! \e[0m" echo -e "\e[1;33mWarning! GitHub-Actions-tolerant mode requested but not running on GitHub-Actions! \e[0m"
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] elif [ "$GITHUB_EVENT_NAME" == "pull_request" ]
then then
TOLERANT="yes"
else
TOLERANT="no" TOLERANT="no"
else
TOLERANT="yes"
fi fi
shift shift
else else
+2 -2
View File
@@ -174,7 +174,7 @@ def get_arguments():
parser.add_argument('--outdir', metavar='DIR', default=OUTPUT_DIR, parser.add_argument('--outdir', metavar='DIR', default=OUTPUT_DIR,
help='Specify output directory (default: %(default)s)') help='Specify output directory (default: %(default)s)')
parser.add_argument('--check-signed-off', metavar='TYPE', nargs='?', parser.add_argument('--check-signed-off', metavar='TYPE', nargs='?',
choices=['strict', 'tolerant', 'travis'], const='strict', choices=['strict', 'tolerant', 'gh-actions'], const='strict',
help='Run signed-off check (%(choices)s; default type if not given: %(const)s)') help='Run signed-off check (%(choices)s; default type if not given: %(const)s)')
parser.add_argument('--check-cppcheck', action='store_true', parser.add_argument('--check-cppcheck', action='store_true',
help='Run cppcheck') help='Run cppcheck')
@@ -472,7 +472,7 @@ Check = collections.namedtuple('Check', ['enabled', 'runner', 'arg'])
def main(options): def main(options):
checks = [ checks = [
Check(options.check_signed_off, run_check, [settings.SIGNED_OFF_SCRIPT] Check(options.check_signed_off, run_check, [settings.SIGNED_OFF_SCRIPT]
+ {'tolerant': ['--tolerant'], 'travis': ['--travis']}.get(options.check_signed_off, [])), + {'tolerant': ['--tolerant'], 'gh-actions': ['--gh-actions']}.get(options.check_signed_off, [])),
Check(options.check_cppcheck, run_check, [settings.CPPCHECK_SCRIPT]), Check(options.check_cppcheck, run_check, [settings.CPPCHECK_SCRIPT]),
Check(options.check_doxygen, run_check, [settings.DOXYGEN_SCRIPT]), Check(options.check_doxygen, run_check, [settings.DOXYGEN_SCRIPT]),
Check(options.check_pylint, run_check, [settings.PYLINT_SCRIPT]), Check(options.check_pylint, run_check, [settings.PYLINT_SCRIPT]),