Enable pan-project checks
Enables the canned pan-project presubmit checks for "Chromium orbit"
projects.
The license check is disabled, as 2436 files currently fail this check
with "git cl presubmit --all".
This change also switches to the "2.0.0" presubmit format (any function
name that starts with "Check" is a check), and fixes presubmit warnings
in PRESUBMIT.py itself (license header and too-long lines).
Bug: pdfium:1884
Change-Id: Id7d8829a64ed14c529d8e63e89402d37dd8e0b14
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/100370
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: K. Moon <kmoon@chromium.org>
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 8f2c59a..ea18500 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -1,4 +1,4 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
+# Copyright 2015 The PDFium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -8,6 +8,8 @@
for more details about the presubmit API built into depot_tools.
"""
+PRESUBMIT_VERSION = '2.0.0'
+
USE_PYTHON3 = True
LINT_FILTERS = [
@@ -51,9 +53,11 @@
(
r'/\busing namespace ',
(
- 'Using directives ("using namespace x") are banned by the Google Style',
- 'Guide ( https://google.github.io/styleguide/cppguide.html#Namespaces ).',
- 'Explicitly qualify symbols or use using declarations ("using x::foo").',
+ 'Using directives ("using namespace x") are banned by the Google',
+ 'Style Guide (',
+ 'https://google.github.io/styleguide/cppguide.html#Namespaces ).',
+ 'Explicitly qualify symbols or use using declarations ("using',
+ 'x::foo").',
),
True,
[_THIRD_PARTY],
@@ -61,9 +65,10 @@
(
r'/v8::Isolate::(?:|Try)GetCurrent()',
(
- 'v8::Isolate::GetCurrent() and v8::Isolate::TryGetCurrent() are banned. Hold',
- 'a pointer to the v8::Isolate that was entered. Use v8::Isolate::IsCurrent()',
- 'to check whether a given v8::Isolate is entered.',
+ 'v8::Isolate::GetCurrent() and v8::Isolate::TryGetCurrent() are',
+ 'banned. Hold a pointer to the v8::Isolate that was entered. Use',
+ 'v8::Isolate::IsCurrent() to check whether a given v8::Isolate is',
+ 'entered.',
),
True,
(),
@@ -486,6 +491,18 @@
return results
+def ChecksCommon(input_api, output_api):
+ results = []
+
+ # TODO(crbug.com/pdfium/1884): Fix existing breakage, then remove
+ # license_header='.*' to enable the license check.
+ results.extend(
+ input_api.canned_checks.PanProjectChecks(
+ input_api, output_api, license_header='.*', project_name='PDFium'))
+
+ return results
+
+
def CheckChangeOnUpload(input_api, output_api):
results = []
results.extend(_CheckNoBannedFunctions(input_api, output_api))