Exemple #1
0
def _V8PresubmitChecks(input_api, output_api):
    """Runs the V8 presubmit checks."""
    import sys
    sys.path.append(
        input_api.os_path.join(input_api.PresubmitLocalPath(), 'tools'))
    from presubmit import CppLintProcessor
    from presubmit import SourceProcessor
    from presubmit import CheckRuntimeVsNativesNameClashes
    from presubmit import CheckExternalReferenceRegistration
    from presubmit import CheckAuthorizedAuthor

    results = []
    if not CppLintProcessor().Run(input_api.PresubmitLocalPath()):
        results.append(output_api.PresubmitError("C++ lint check failed"))
    if not SourceProcessor().Run(input_api.PresubmitLocalPath()):
        results.append(output_api.PresubmitError(
            "Copyright header, trailing whitespaces and two empty lines " \
            "between declarations check failed"))
    if not CheckRuntimeVsNativesNameClashes(input_api.PresubmitLocalPath()):
        results.append(
            output_api.PresubmitError(
                "Runtime/natives name clash check failed"))
    if not CheckExternalReferenceRegistration(input_api.PresubmitLocalPath()):
        results.append(
            output_api.PresubmitError(
                "External references registration check failed"))
    results.extend(CheckAuthorizedAuthor(input_api, output_api))
    return results
Exemple #2
0
def _V8PresubmitChecks(input_api, output_api):
    """Runs the V8 presubmit checks."""
    import sys
    sys.path.append(
        input_api.os_path.join(input_api.PresubmitLocalPath(), 'tools'))
    from presubmit import CppLintProcessor
    from presubmit import SourceProcessor
    from presubmit import CheckGeneratedRuntimeTests
    from presubmit import CheckExternalReferenceRegistration

    results = []
    if not CppLintProcessor().Run(input_api.PresubmitLocalPath()):
        results.append(output_api.PresubmitError("C++ lint check failed"))
    if not SourceProcessor().Run(input_api.PresubmitLocalPath()):
        results.append(output_api.PresubmitError(
            "Copyright header, trailing whitespaces and two empty lines " \
            "between declarations check failed"))
    if not CheckGeneratedRuntimeTests(input_api.PresubmitLocalPath()):
        results.append(
            output_api.PresubmitError("Generated runtime tests check failed"))
    if not CheckExternalReferenceRegistration(input_api.PresubmitLocalPath()):
        results.append(
            output_api.PresubmitError(
                "External references registration check failed"))
    return results