Skip to content

Commit 316dbb4

Browse files
authored
[clang-tidy][NFC] Reformat code and set 'KeepEmptyLines' to false (#168131)
Currently, default `clang-format` LLVM style is configured like this: ``` KeepEmptyLines: AtEndOfFile: false AtStartOfBlock: true AtStartOfFile: true ``` This PR sets `AtStartOfBlock` and `AtStartOfFile` to false. I think this is the general style pattern we tend to follow, in particular Eugene made comments about empty newlines at start of functions.
1 parent af098e0 commit 316dbb4

File tree

51 files changed

+12
-80
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+12
-80
lines changed
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
BasedOnStyle: LLVM
2-
QualifierAlignment: Left
3-
LineEnding: LF
42
InsertNewlineAtEOF: true
3+
KeepEmptyLines:
4+
AtEndOfFile: false
5+
AtStartOfBlock: false
6+
AtStartOfFile: false
7+
LineEnding: LF
8+
QualifierAlignment: Left

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,6 @@ void ClangTidyDiagnosticConsumer::removeDuplicatedDiagnosticsOfAliasCheckers() {
819819
(*Inserted.first)->Message.Fix;
820820

821821
if (CandidateFix != ExistingFix) {
822-
823822
// In case of a conflict, don't suggest any fix-it.
824823
ExistingError.Message.Fix.clear();
825824
ExistingError.Notes.emplace_back(

clang-tools-extra/clang-tidy/altera/KernelNameRestrictionCheck.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ bool KernelNameRestrictionPPCallbacks::fileNameIsRestricted(
7474
}
7575

7676
void KernelNameRestrictionPPCallbacks::EndOfMainFile() {
77-
7877
// Check main file for restricted names.
7978
OptionalFileEntryRef Entry = SM.getFileEntryRefForID(SM.getMainFileID());
8079
const StringRef FileName = llvm::sys::path::filename(Entry->getName());

clang-tools-extra/clang-tidy/boost/UseRangesCheck.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ class FixedBoostReplace : public BoostReplacer {
201201
} // namespace
202202

203203
utils::UseRangesCheck::ReplacerMap UseRangesCheck::getReplacerMap() const {
204-
205204
ReplacerMap Results;
206205
static const Signature SingleSig = {{0}};
207206
static const Signature TwoSig = {{0}, {2}};

clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ void BranchCloneCheck::registerMatchers(MatchFinder *Finder) {
117117
///
118118
static bool isIdenticalStmt(const ASTContext &Ctx, const Stmt *Stmt1,
119119
const Stmt *Stmt2, bool IgnoreSideEffects) {
120-
121120
if (!Stmt1 || !Stmt2)
122121
return !Stmt1 && !Stmt2;
123122

clang-tools-extra/clang-tidy/bugprone/ComparePointerToMemberVirtualFunctionCheck.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ static constexpr llvm::StringLiteral ErrorMsg =
3434

3535
void ComparePointerToMemberVirtualFunctionCheck::registerMatchers(
3636
MatchFinder *Finder) {
37-
3837
auto DirectMemberVirtualFunctionPointer = unaryOperator(
3938
allOf(hasOperatorName("&"),
4039
hasUnaryOperand(declRefExpr(to(cxxMethodDecl(isVirtual()))))));

clang-tools-extra/clang-tidy/bugprone/DanglingHandleCheck.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ handleFrom(const ast_matchers::internal::Matcher<RecordDecl> &IsAHandle,
3131

3232
static ast_matchers::internal::Matcher<Stmt> handleFromTemporaryValue(
3333
const ast_matchers::internal::Matcher<RecordDecl> &IsAHandle) {
34-
3534
const auto TemporaryExpr = anyOf(
3635
cxxBindTemporaryExpr(),
3736
cxxFunctionalCastExpr(

clang-tools-extra/clang-tidy/bugprone/IncDecInConditionsCheck.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ void IncDecInConditionsCheck::registerMatchers(MatchFinder *Finder) {
6464
}
6565

6666
void IncDecInConditionsCheck::check(const MatchFinder::MatchResult &Result) {
67-
6867
SourceLocation ExprLoc;
6968
bool IsIncrementOp = false;
7069

clang-tools-extra/clang-tidy/bugprone/MacroParenthesesCheck.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ void MacroParenthesesPPCallbacks::replacementList(const Token &MacroNameTok,
152152

153153
void MacroParenthesesPPCallbacks::argument(const Token &MacroNameTok,
154154
const MacroInfo *MI) {
155-
156155
// Skip variable declaration.
157156
bool VarDecl = possibleVarDecl(MI, MI->tokens_begin());
158157

clang-tools-extra/clang-tidy/bugprone/NondeterministicPointerIterationOrderCheck.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ namespace clang::tidy::bugprone {
1515

1616
void NondeterministicPointerIterationOrderCheck::registerMatchers(
1717
MatchFinder *Finder) {
18-
1918
auto LoopVariable = varDecl(hasType(
2019
qualType(hasCanonicalType(anyOf(referenceType(), pointerType())))));
2120

0 commit comments

Comments
 (0)