[clang-tools-extra] [clang-tidy] Add new check readability-trailing-comma (PR #173669)

Victor Chernyakin via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 26 08:40:43 PST 2025


================
@@ -0,0 +1,83 @@
+.. title:: clang-tidy - readability-trailing-comma
+
+readability-trailing-comma
+==========================
+
+Checks for presence or absence of trailing commas in enum definitions and
+initializer lists.
+
+The check can either append trailing commas where they are missing or remove
+them where they are present, based on the configured policy.
+
+Trailing commas offer several benefits:
+
+- Adding or removing elements may only changes a single line, making diffs
----------------
localspook wrote:

```suggestion
- Adding or removing elements at the end only changes a single line, making diffs
```

https://github.com/llvm/llvm-project/pull/173669


More information about the cfe-commits mailing list