Skip to content

Commit

Permalink
Format: insert Newline at EOF using clang-format-17 (#8929)
Browse files Browse the repository at this point in the history
ref #6233

Signed-off-by: Lloyd-Pottiger <[email protected]>
  • Loading branch information
Lloyd-Pottiger authored Jun 25, 2024
1 parent 06427c4 commit fbcb42e
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 30 deletions.
48 changes: 25 additions & 23 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
BasedOnStyle: Google
Language: Cpp
BasedOnStyle: Google
Language: Cpp
AlignAfterOpenBracket: AlwaysBreak
AlignEscapedNewlines: Left
AlignTrailingComments: false
Expand All @@ -16,20 +16,20 @@ BinPackArguments: false
BinPackParameters: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum : true
AfterFunction : true
AfterNamespace : true
AfterStruct : true
AfterUnion : true
BeforeCatch : true
BeforeElse : true
IndentBraces : false
SplitEmptyFunction: false
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: false
BreakConstructorInitializers: BeforeComma
BreakInheritanceList : BeforeComma
BreakInheritanceList: BeforeComma
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: false
Cpp11BracedListStyle: true
Expand All @@ -47,28 +47,31 @@ SpaceAfterTemplateKeyword: true
Standard: c++20
TabWidth: 4
UseTab: Never
InsertNewlineAtEOF: true
InsertTrailingCommas: Wrapped
RemoveSemicolon: true

# Not changed:
AccessModifierOffset: -4
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignOperands: false
AlignOperands: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: All
BreakBeforeTernaryOperators: true
CommentPragmas: '^ IWYU pragma:'
CommentPragmas: "^ IWYU pragma:"
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IndentWidth: 4
DisableFormat: false
ForEachMacros: [foreach, Q_FOREACH, BOOST_FOREACH]
IndentWidth: 4
IndentWrappedFunctionNames: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MacroBlockBegin: ""
MacroBlockEnd: ""
NamespaceIndentation: None
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: true
Expand All @@ -92,4 +95,3 @@ SpacesInSquareBrackets: false
Language: Proto
# Added to avoid annoying error message
DisableFormat: true
...
1 change: 0 additions & 1 deletion dbms/src/Client/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ class Connection : private boost::noncopyable
}

virtual ~Connection() = default;
;

/// Set throttler of network traffic. One throttler could be used for multiple connections to limit total traffic.
void setThrottler(const ThrottlerPtr & throttler_) { throttler = throttler_; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,4 +467,4 @@ try
}
CATCH

} // namespace DB::DM::tests
} // namespace DB::DM::tests
2 changes: 1 addition & 1 deletion dbms/src/Storages/KVStore/Decode/RegionScanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ RegionDataReadInfo Region::CommittedScanner::next()
peeked.reset();
return res;
}
} // namespace DB
} // namespace DB
2 changes: 1 addition & 1 deletion dbms/src/Storages/KVStore/Read/Proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ bool TiFlashRaftProxyHelper::pollTimerTask(TimerTask & task, RawVoidPtr waker) c
{
return fn_poll_timer_task(task.ptr, waker);
}
} // namespace DB
} // namespace DB
2 changes: 1 addition & 1 deletion dbms/src/Storages/KVStore/Read/ReadIndexDataNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,4 @@ ReadIndexFuturePtr ReadIndexDataNode::insertTask(const kvrpcpb::ReadIndexRequest
return task;
}

} // namespace DB
} // namespace DB
2 changes: 1 addition & 1 deletion dbms/src/Storages/KVStore/tests/gtest_async_tasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,4 +340,4 @@ try
CATCH

} // namespace tests
} // namespace DB
} // namespace DB
2 changes: 1 addition & 1 deletion format-diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def run_cmd(cmd, show_cmd=False):
return res

def try_find_clang_format(exec_path):
candidates = ['clang-format-15', 'clang-format']
candidates = ['clang-format']
if exec_path is not None:
candidates.insert(0, exec_path)
for c in candidates:
Expand Down

0 comments on commit fbcb42e

Please sign in to comment.