[formatting] Remove the formatting requirement for 2 empty lines between declarations.

R=mstarzinger@chromium.org,rossberg@chromium.org,bmeurer@chromium.org,hpayer@chromium.org,jochen@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1600873002

Cr-Commit-Position: refs/heads/master@{#33485}
This commit is contained in:
titzer 2016-01-25 01:49:58 -08:00 committed by Commit bot
parent 5ef27c25e9
commit 28d3cba243
2 changed files with 1 additions and 25 deletions

View File

@ -1,4 +1,4 @@
# Defines the Google C++ style for automatic reformatting.
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
BasedOnStyle: Google
MaxEmptyLinesToKeep: 2
MaxEmptyLinesToKeep: 1

View File

@ -354,30 +354,6 @@ class SourceProcessor(SourceFileProcessor):
if not contents.endswith('\n') or contents.endswith('\n\n'):
print "%s does not end with a single new line." % name
result = False
# Check two empty lines between declarations.
if name.endswith(".cc"):
line = 0
lines = []
parts = contents.split('\n')
while line < len(parts) - 2:
if self.EndOfDeclaration(parts[line]):
if self.StartOfDeclaration(parts[line + 1]):
lines.append(str(line + 1))
line += 1
elif parts[line + 1] == "" and \
self.StartOfDeclaration(parts[line + 2]):
lines.append(str(line + 1))
line += 2
line += 1
if len(lines) >= 1:
linenumbers = ', '.join(lines)
if len(lines) > 1:
print "%s does not have two empty lines between declarations " \
"in lines %s." % (name, linenumbers)
else:
print "%s does not have two empty lines between declarations " \
"in line %s." % (name, linenumbers)
result = False
# Sanitize flags for fuzzer.
if "mjsunit" in name:
match = FLAGS_LINE.search(contents)