mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
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:
parent
5e34a5e978
commit
fb6ea035d3
2
.github/workflows/gh-actions.yml
vendored
2
.github/workflows/gh-actions.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
||||
- name: Initializtaion
|
||||
run: sudo apt-get install doxygen vera++ cppcheck pylint pylint python-serial -q
|
||||
- name: Signed-off
|
||||
run: $RUNNER --check-signed-off=travis
|
||||
run: $RUNNER --check-signed-off=gh-actions
|
||||
- name: Doxygen
|
||||
run: $RUNNER --check-doxygen
|
||||
- name: Vera++
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
# Usage
|
||||
function print_usage
|
||||
{
|
||||
echo "Usage: $0 [--help] [--tolerant] [--travis]"
|
||||
echo "Usage: $0 [--help] [--tolerant] [--gh-actions]"
|
||||
}
|
||||
|
||||
function print_help
|
||||
@ -31,7 +31,7 @@ function print_help
|
||||
echo " --tolerant check the existence of the message only but don't"
|
||||
echo " require the name and email address to match the author"
|
||||
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 ""
|
||||
echo "The last line of every commit message must follow the form of:"
|
||||
@ -52,16 +52,16 @@ do
|
||||
then
|
||||
TOLERANT="yes"
|
||||
shift
|
||||
elif [ "$1" == "--travis" ]
|
||||
elif [ "$1" == "--gh-actions" ]
|
||||
then
|
||||
if [ "$TRAVIS_PULL_REQUEST" == "" ]
|
||||
if [ "$GITHUB_EVENT_NAME" == "" ]
|
||||
then
|
||||
echo -e "\e[1;33mWarning! Travis-tolerant mode requested but not running on Travis CI! \e[0m"
|
||||
elif [ "$TRAVIS_PULL_REQUEST" == "false" ]
|
||||
echo -e "\e[1;33mWarning! GitHub-Actions-tolerant mode requested but not running on GitHub-Actions! \e[0m"
|
||||
elif [ "$GITHUB_EVENT_NAME" == "pull_request" ]
|
||||
then
|
||||
TOLERANT="yes"
|
||||
else
|
||||
TOLERANT="no"
|
||||
else
|
||||
TOLERANT="yes"
|
||||
fi
|
||||
shift
|
||||
else
|
||||
|
||||
@ -174,7 +174,7 @@ def get_arguments():
|
||||
parser.add_argument('--outdir', metavar='DIR', default=OUTPUT_DIR,
|
||||
help='Specify output directory (default: %(default)s)')
|
||||
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)')
|
||||
parser.add_argument('--check-cppcheck', action='store_true',
|
||||
help='Run cppcheck')
|
||||
@ -472,7 +472,7 @@ Check = collections.namedtuple('Check', ['enabled', 'runner', 'arg'])
|
||||
def main(options):
|
||||
checks = [
|
||||
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_doxygen, run_check, [settings.DOXYGEN_SCRIPT]),
|
||||
Check(options.check_pylint, run_check, [settings.PYLINT_SCRIPT]),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user