From 2cc6e25536698e4f87d516f5242dd9d30d3245ba Mon Sep 17 00:00:00 2001 From: Clemens Hammacher Date: Thu, 20 Dec 2018 08:40:19 +0000 Subject: [PATCH] [cpplint] Fix regexp for class decorators This also allows digits in class decorators, to also match macros like V8_EXPORT_PRIVATE. Note: I uploaded a pull request for the (previous) upstream at https://github.com/google/styleguide/pull/422, but then was told that that repository is not maintained any more. R=jochen@chromium.org Bug: chromium:916550 Change-Id: I24cd1829b794b296be8e0c2829271c746751ee1c Reviewed-on: https://chromium-review.googlesource.com/c/1383472 Commit-Queue: Clemens Hammacher Reviewed-by: Jochen Eisinger --- README.md | 7 +++++-- cpplint.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3d4300f43..fee7de79d 100644 --- a/README.md +++ b/README.md @@ -67,5 +67,8 @@ See also [open bugs](https://bugs.chromium.org/p/chromium/issues/list?can=2&q=co ### cpplint.py -To update cpplint.py, please submit the change upstream first at -https://github.com/google/styleguide/tree/gh-pages/cpplint then copy it down. +Until 2018, our `cpplint.py` was a copy of the upstream version at +https://github.com/google/styleguide/tree/gh-pages/cpplint. Unfortunately, that +repository is not maintained any more. +If you want to update `cpplint.py` in `depot_tools`, just upload a patch to do +so. We will figure out a long-term strategy via issue https://crbug.com/916550. diff --git a/cpplint.py b/cpplint.py index 42e3da3ba..e3b36c6cc 100755 --- a/cpplint.py +++ b/cpplint.py @@ -2530,7 +2530,7 @@ class NestingState(object): # }; class_decl_match = Match( r'^(\s*(?:template\s*<[\w\s<>,:]*>\s*)?' - r'(class|struct)\s+(?:[A-Z_]+\s+)*(\w+(?:::\w+)*))' + r'(class|struct)\s+(?:[A-Z0-9_]+\s+)*(\w+(?:::\w+)*))' r'(.*)$', line) if (class_decl_match and (not self.stack or self.stack[-1].open_parentheses == 0)):