Add presubmit check for base::Bind/base::Callback
In order to reduce the number of base::Bind/base::Callback uses added to
the codebase while we are in the process of a migration, we can add a
global PRESUBMIT.py hook to nudge people to use the new interfaces.
Bug: 714018
Test: git cl try
Change-Id: I60741a1532a060fc75f3aeb1533e88abbdf9cfe7
Reviewed-on: https://chromium-review.googlesource.com/794879
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Taiju Tsuiki <tzik@chromium.org>
Commit-Queue: Luis Hector Chavez <lhchavez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520611}
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index cb960bd..a01cc0f 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -437,6 +437,33 @@
True,
(),
),
+ (
+ r'/\bbase::Bind\(',
+ (
+ 'Please consider using base::Bind{Once,Repeating} instead '
+ 'of base::Bind. (crbug/714018)',
+ ),
+ False,
+ (),
+ ),
+ (
+ r'/\bbase::Callback<',
+ (
+ 'Please consider using base::{Once,Repeating}Callback instead '
+ 'of base::Callback. (crbug/714018)',
+ ),
+ False,
+ (),
+ ),
+ (
+ r'/\bbase::Closure\b',
+ (
+ 'Please consider using base::{Once,Repeating}Closure instead '
+ 'of base::Closure. (crbug/714018)',
+ ),
+ False,
+ (),
+ ),
)