mirror of
https://github.com/google/styleguide.git
synced 2024-03-22 13:11:43 +08:00
Allow single line lambdas
This commit is contained in:
parent
355baf6964
commit
c195fb5775
3
cpplint/cpplint.py
vendored
3
cpplint/cpplint.py
vendored
|
@ -4459,6 +4459,9 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state,
|
|||
'Lines should be <= %i characters long' % _line_length)
|
||||
|
||||
if (cleansed_line.count(';') > 1 and
|
||||
# allow simple single line lambdas
|
||||
not Match(r'^[^{};]*\[[^\[\]]*\][^{}]*\{[^{}\n\r]*\}',
|
||||
line) and
|
||||
# for loops are allowed two ;'s (and may run over two lines).
|
||||
cleansed_line.find('for') == -1 and
|
||||
(GetPreviousNonBlankLine(clean_lines, linenum)[0].find('for') == -1 or
|
||||
|
|
Loading…
Reference in New Issue
Block a user