Add tolerant mode to Signed-off-by check (#1322)
In tolerant mode, only the existence of the Signed-off-by line is checked but the name and address is not matched against the author of the commit. The tools/run-tests.py script is extended to allow calling the check script in tolerant mode and also to detect whether it is being run by Travis CI. The Travis CI config has been modified to check PRs in strict mode but use tolerant mode for merges to master. This should enable the use of the Merge button on the GitHub web interface. (The PR is strictly checked when a contributor opens it but when a committer merges it via the web interface and GitHub rewrites author details from the contributor's profile, master will not turn red either.) JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
committed by
Tilmann Scheller
parent
714e8d261b
commit
8d478c142b
+11
-1
@@ -16,6 +16,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from settings import *
|
||||
@@ -26,6 +27,8 @@ parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--toolchain', action='store', default='', help='Add toolchain file')
|
||||
parser.add_argument('--outdir', action='store', default=OUTPUT_DIR, help='Specify output directory (default: %(default)s)')
|
||||
parser.add_argument('--check-signed-off', action='store_true', default=False, help='Run signed-off check')
|
||||
parser.add_argument('--check-signed-off-tolerant', action='store_true', default=False, help='Run signed-off check in tolerant mode')
|
||||
parser.add_argument('--check-signed-off-travis', action='store_true', default=False, help='Run signed-off check in tolerant mode if on Travis CI and not checking a pull request')
|
||||
parser.add_argument('--check-cppcheck', action='store_true', default=False, help='Run cppcheck')
|
||||
parser.add_argument('--check-vera', action='store_true', default=False, help='Run vera check')
|
||||
parser.add_argument('--buildoption-test', action='store_true', default=False, help='Run buildoption-test')
|
||||
@@ -180,7 +183,14 @@ def run_buildoption_test():
|
||||
def main():
|
||||
ret = 0
|
||||
|
||||
if script_args.all or script_args.check_signed_off:
|
||||
if script_args.check_signed_off_tolerant:
|
||||
ret = run_check([SIGNED_OFF_SCRIPT, '--tolerant'])
|
||||
|
||||
if not ret and script_args.check_signed_off_travis:
|
||||
runnable = SIGNED_OFF_SCRIPT if os.getenv('TRAVIS_PULL_REQUEST', '0') != 'false' else [SIGNED_OFF_SCRIPT, '--tolerant']
|
||||
ret = run_check(runnable)
|
||||
|
||||
if not ret and (script_args.all or script_args.check_signed_off):
|
||||
ret = run_check(SIGNED_OFF_SCRIPT)
|
||||
|
||||
if not ret and (script_args.all or script_args.check_cppcheck):
|
||||
|
||||
Reference in New Issue
Block a user