| Index: ui/PRESUBMIT.py
|
| diff --git a/ui/PRESUBMIT.py b/ui/PRESUBMIT.py
|
| index 4ee1ec87e3a7a8e181fea6606c602131c63c68ef..9a8e7398dbe918b10f0875470229a2529ff5fde2 100644
|
| --- a/ui/PRESUBMIT.py
|
| +++ b/ui/PRESUBMIT.py
|
| @@ -33,13 +33,12 @@ def CheckUniquePtr(input_api, output_api,
|
| ('%s:%d uses explicit std::unique_ptr constructor. ' +
|
| 'Use base::MakeUnique<T>() or base::WrapUnique() instead.') %
|
| (f.LocalPath(), line_number)))
|
| - # TODO(sky): this incorrectly catches templates. Fix and reenable.
|
| # Disallow:
|
| # std::unique_ptr<T>()
|
| - # if input_api.re.search(r'\bstd::unique_ptr<.*?>\(\)', line):
|
| - # errors.append(output_api.PresubmitError(
|
| - # '%s:%d uses std::unique_ptr<T>(). Use nullptr instead.' %
|
| - # (f.LocalPath(), line_number)))
|
| + if input_api.re.search(r'\bstd::unique_ptr<[^<>]+>\(\)', line):
|
| + errors.append(output_api.PresubmitError(
|
| + '%s:%d uses std::unique_ptr<T>(). Use nullptr instead.' %
|
| + (f.LocalPath(), line_number)))
|
| return errors
|
|
|
|
|
|
|