https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/176926
Welcome everyone to YAFI (yet another format improvements) in 2026:) Starting from `clang-format-16` we have quite useful option `RemoveSemicolon`. >From b1333b57e7bdcb6d12d84bac9612f4c213fcf780 Mon Sep 17 00:00:00 2001 From: Victor Baranov <[email protected]> Date: Tue, 20 Jan 2026 16:42:38 +0300 Subject: [PATCH] [clang-tidy][NFC] Enable RemoveSemicolon in clang-format config --- clang-tools-extra/clang-tidy/.clang-format | 1 + clang-tools-extra/clang-tidy/ClangTidy.cpp | 2 +- clang-tools-extra/clang-tidy/GlobList.h | 2 +- .../clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp | 2 +- .../clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp | 6 +++--- .../clang-tidy/modernize/UseDesignatedInitializersCheck.cpp | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/clang-tools-extra/clang-tidy/.clang-format b/clang-tools-extra/clang-tidy/.clang-format index 96fb7ce8fce61..1b342d3f71f71 100644 --- a/clang-tools-extra/clang-tidy/.clang-format +++ b/clang-tools-extra/clang-tidy/.clang-format @@ -7,3 +7,4 @@ KeepEmptyLines: LineEnding: LF QualifierAlignment: Left RemoveBracesLLVM: true +RemoveSemicolon: true diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp index da2b4e577c9ed..c6498521be2d9 100644 --- a/clang-tools-extra/clang-tidy/ClangTidy.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp @@ -339,7 +339,7 @@ class ClangTidyASTConsumer : public MultiplexConsumer { 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 diff --git a/clang-tools-extra/clang-tidy/GlobList.h b/clang-tools-extra/clang-tidy/GlobList.h index c9086df2b7973..9567abf6b1d10 100644 --- a/clang-tools-extra/clang-tidy/GlobList.h +++ b/clang-tools-extra/clang-tidy/GlobList.h @@ -49,7 +49,7 @@ class GlobList { 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 diff --git a/clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp index 6e1626668d7f1..eec567dfb2a61 100644 --- a/clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp @@ -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; diff --git a/clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp index 701c0e56e6f99..e3cb824deb5e2 100644 --- a/clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp @@ -104,7 +104,7 @@ class CharExpressionDetector { // 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 @@ class CharExpressionDetector { 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; diff --git a/clang-tools-extra/clang-tidy/modernize/UseDesignatedInitializersCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseDesignatedInitializersCheck.cpp index e798f6f6bbd1e..5a8f3e3c9e922 100644 --- a/clang-tools-extra/clang-tidy/modernize/UseDesignatedInitializersCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseDesignatedInitializersCheck.cpp @@ -51,7 +51,7 @@ namespace { struct Designators { Designators(const InitListExpr *InitList) : InitList(InitList) { assert(InitList->isSyntacticForm()); - }; + } unsigned size() { return getCached().size(); } _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
