[clang-tidy][NFC] Enable RemoveSemicolon in clang-format config (#176926)

Welcome everyone to YAFI (yet another format improvements) in 2026:)
Starting from `clang-format-16` we have quite useful option
`RemoveSemicolon`.
This commit is contained in:
Baranov Victor 2026-01-21 12:10:03 +03:00 committed by GitHub
parent b9760dc6fb
commit fa98edd447
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 8 additions and 7 deletions

View File

@ -7,3 +7,4 @@ KeepEmptyLines:
LineEnding: LF
QualifierAlignment: Left
RemoveBracesLLVM: true
RemoveSemicolon: true

View File

@ -339,7 +339,7 @@ private:
std::unique_ptr<ClangTidyProfiling> Profiling;
std::unique_ptr<ast_matchers::MatchFinder> Finder;
std::vector<std::unique_ptr<ClangTidyCheck>> Checks;
void anchor() override {};
void anchor() override {}
};
} // namespace

View File

@ -49,7 +49,7 @@ private:
SmallVector<GlobListItem, 0> Items;
public:
const SmallVectorImpl<GlobListItem> &getItems() const { return Items; };
const SmallVectorImpl<GlobListItem> &getItems() const { return Items; }
};
/// A \p GlobList that caches search results, so that search is performed only

View File

@ -679,7 +679,7 @@ void NotNullTerminatedResultCheck::registerMatchers(MatchFinder *Finder) {
std::optional<unsigned> SourcePos, unsigned LengthPos,
bool WithIncrease)
: Name(Name), DestinationPos(DestinationPos), SourcePos(SourcePos),
LengthPos(LengthPos), WithIncrease(WithIncrease) {};
LengthPos(LengthPos), WithIncrease(WithIncrease) {}
StringRef Name;
std::optional<unsigned> DestinationPos;

View File

@ -104,7 +104,7 @@ private:
// Returns true if `E` is an character constant.
bool isCharConstant(const Expr *E) const {
return isCharTyped(E) && isCharValuedConstant(E);
};
}
// Returns true if `E` is an integer constant which fits in `CharType`.
bool isCharValuedConstant(const Expr *E) const {
@ -114,13 +114,13 @@ private:
if (!E->EvaluateAsInt(EvalResult, Ctx, Expr::SE_AllowSideEffects))
return false;
return EvalResult.Val.getInt().getActiveBits() <= Ctx.getTypeSize(CharType);
};
}
// Returns true if `E` has the right character type.
bool isCharTyped(const Expr *E) const {
return E->getType().getCanonicalType().getTypePtr() ==
CharType.getTypePtr();
};
}
const QualType CharType;
const ASTContext &Ctx;

View File

@ -51,7 +51,7 @@ namespace {
struct Designators {
Designators(const InitListExpr *InitList) : InitList(InitList) {
assert(InitList->isSyntacticForm());
};
}
unsigned size() { return getCached().size(); }