Exemplo n.º 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 StatusFilesProcessor

    def FilterFile(affected_file):
        return input_api.FilterSourceFile(affected_file,
                                          white_list=None,
                                          black_list=_NO_LINT_PATHS)

    results = []
    if not CppLintProcessor().RunOnFiles(
            input_api.AffectedFiles(file_filter=FilterFile,
                                    include_deletes=False)):
        results.append(output_api.PresubmitError("C++ lint check failed"))
    if not SourceProcessor().RunOnFiles(
            input_api.AffectedFiles(include_deletes=False)):
        results.append(output_api.PresubmitError(
            "Copyright header, trailing whitespaces and two empty lines " \
            "between declarations check failed"))
    if not StatusFilesProcessor().RunOnFiles(
            input_api.AffectedFiles(include_deletes=True)):
        results.append(output_api.PresubmitError("Status file check failed"))
    results.extend(
        input_api.canned_checks.CheckAuthorizedAuthor(
            input_api,
            output_api,
            bot_whitelist=[
                '*****@*****.**'
            ]))
    return results
Exemplo n.º 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 StatusFilesProcessor

    results = []
    if not CppLintProcessor().RunOnFiles(
            input_api.AffectedFiles(include_deletes=False)):
        results.append(output_api.PresubmitError("C++ lint check failed"))
    if not SourceProcessor().RunOnFiles(
            input_api.AffectedFiles(include_deletes=False)):
        results.append(output_api.PresubmitError(
            "Copyright header, trailing whitespaces and two empty lines " \
            "between declarations check failed"))
    if not StatusFilesProcessor().RunOnFiles(
            input_api.AffectedFiles(include_deletes=False)):
        results.append(output_api.PresubmitError("Status file check failed"))
    results.extend(
        input_api.canned_checks.CheckAuthorizedAuthor(input_api, output_api))
    return results