From d45d17b2a3a6fe6e456989cbeb11a666ddc3b42d Mon Sep 17 00:00:00 2001 From: Lei Jin Date: Thu, 20 Feb 2014 12:47:05 -0800 Subject: [PATCH] allow lambda function syntax in cpplint Summary: as title Test Plan: arc lint Reviewers: kailiu Reviewed By: kailiu CC: leveldb Differential Revision: https://reviews.facebook.net/D16251 --- linters/cpp_linter/cpplint.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linters/cpp_linter/cpplint.py b/linters/cpp_linter/cpplint.py index 5f7e169bb..d264b00da 100755 --- a/linters/cpp_linter/cpplint.py +++ b/linters/cpp_linter/cpplint.py @@ -3104,6 +3104,11 @@ def CheckBraces(filename, clean_lines, linenum, error): 'LOCKS_EXCLUDED', 'INTERFACE_DEF')) or Search(r'\s+=\s*$', line_prefix)): match = None + # Whitelist lambda function definition which also requires a ";" after + # closing brace + if match: + if Match(r'^.*\[.*\]\s*(.*\)\s*)\{', line): + match = None else: # Try matching cases 2-3.