From: Simon Marchi Date: Fri, 15 Mar 2024 20:11:33 +0000 (-0400) Subject: .clang-tidy: enable cppcoreguidelines-avoid-const-or-ref-data-members X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=4b9e2e3d5986e17f1594c24dea430cb51a529360;ds=sidebyside .clang-tidy: enable cppcoreguidelines-avoid-const-or-ref-data-members Enable: https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-const-or-ref-data-members.html Set the `AllowMissingMoveFunctionsWhenCopyIsDeleted`, so it's less verbose when you just want to delete everything. Set `AllowSoleDefaultDtor`, because we have legitimate cases (when defining virtual base classes) where we only define a default destructor. Perhaps there's a pitfall I don't see when allowing this? Change-Id: I4a8d20c0be628ac807db4c6b52548e3b7d7ee286 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/12090 Reviewed-by: Philippe Proulx --- diff --git a/.clang-tidy b/.clang-tidy index 6a8a29ba..acbb1421 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -55,6 +55,7 @@ Checks: '-*, bugprone-virtual-near-miss, bugprone-unused-raii, bugprone-use-after-move, + cppcoreguidelines-avoid-const-or-ref-data-members, cppcoreguidelines-pro-type-const-cast, cppcoreguidelines-slicing, cppcoreguidelines-special-member-functions, @@ -96,3 +97,7 @@ FormatStyle: 'file' CheckOptions: - key: bugprone-assert-side-effect.AssertMacros value: BT_ASSERT,BT_ASSERT_DBG + - key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor + value: true + - key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctionsWhenCopyIsDeleted + value: true