Skip to content

Commit

Permalink
[formatting] Remove the formatting requirement for 2 empty lines betw…
Browse files Browse the repository at this point in the history
…een 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}
  • Loading branch information
titzer authored and Commit bot committed Jan 25, 2016
1 parent 5ef27c2 commit 28d3cba
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
2 changes: 1 addition & 1 deletion .clang-format
@@ -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
24 changes: 0 additions & 24 deletions tools/presubmit.py
Expand Up @@ -354,30 +354,6 @@ def ProcessContents(self, name, contents):
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)
Expand Down

0 comments on commit 28d3cba

Please sign in to comment.