Runs the V8 presubmit checks.
(input_api, output_api)
| 82 | |
| 83 | |
| 84 | def _V8PresubmitChecks(input_api, output_api): |
| 85 | """Runs the V8 presubmit checks.""" |
| 86 | import sys |
| 87 | sys.path.append(input_api.os_path.join( |
| 88 | input_api.PresubmitLocalPath(), 'tools')) |
| 89 | from v8_presubmit import CppLintProcessor |
| 90 | from v8_presubmit import GCMoleProcessor |
| 91 | from v8_presubmit import JSLintProcessor |
| 92 | from v8_presubmit import TorqueLintProcessor |
| 93 | from v8_presubmit import SourceProcessor |
| 94 | from v8_presubmit import StatusFilesProcessor |
| 95 | |
| 96 | def FilterFile(affected_file): |
| 97 | return input_api.FilterSourceFile( |
| 98 | affected_file, |
| 99 | files_to_check=None, |
| 100 | files_to_skip=_NO_LINT_PATHS) |
| 101 | |
| 102 | def FilterTorqueFile(affected_file): |
| 103 | return input_api.FilterSourceFile( |
| 104 | affected_file, |
| 105 | files_to_check=(r'.+\.tq')) |
| 106 | |
| 107 | def FilterJSFile(affected_file): |
| 108 | return input_api.FilterSourceFile( |
| 109 | affected_file, |
| 110 | files_to_check=(r'.+\.m?js')) |
| 111 | |
| 112 | results = [] |
| 113 | if not CppLintProcessor().RunOnFiles( |
| 114 | input_api.AffectedFiles(file_filter=FilterFile, include_deletes=False)): |
| 115 | results.append(output_api.PresubmitError("C++ lint check failed")) |
| 116 | if not TorqueLintProcessor().RunOnFiles( |
| 117 | input_api.AffectedFiles(file_filter=FilterTorqueFile, |
| 118 | include_deletes=False)): |
| 119 | results.append(output_api.PresubmitError("Torque format check failed")) |
| 120 | if not JSLintProcessor().RunOnFiles( |
| 121 | input_api.AffectedFiles(file_filter=FilterJSFile, |
| 122 | include_deletes=False)): |
| 123 | results.append(output_api.PresubmitError("JS format check failed")) |
| 124 | if not SourceProcessor().RunOnFiles( |
| 125 | input_api.AffectedFiles(include_deletes=False)): |
| 126 | results.append(output_api.PresubmitError( |
| 127 | "Copyright header, trailing whitespaces and two empty lines " \ |
| 128 | "between declarations check failed")) |
| 129 | if not StatusFilesProcessor().RunOnFiles( |
| 130 | input_api.AffectedFiles(include_deletes=True)): |
| 131 | results.append(output_api.PresubmitError("Status file check failed")) |
| 132 | if not GCMoleProcessor().RunOnFiles( |
| 133 | input_api.AffectedFiles(include_deletes=False)): |
| 134 | results.append(output_api.PresubmitError("GCMole pattern check failed")) |
| 135 | results.extend(input_api.canned_checks.CheckAuthorizedAuthor( |
| 136 | input_api, output_api, bot_allowlist=[ |
| 137 | 'v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com', |
| 138 | 'v8-ci-test262-import-export@chops-service-accounts.iam.gserviceaccount.com', |
| 139 | 'chrome-cherry-picker@chops-service-accounts.iam.gserviceaccount.com', |
| 140 | ])) |
| 141 | return results |
nothing calls this directly
no test coverage detected
searching dependent graphs…