[pim/mailcommon] /: .clang-tidy - add the pim clang-tidy configuration

Allen Winter <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 87daca1798809d3e64066e05281db251574ec412 by Allen Winter.
Committed on 17/07/2026 at 10:24.
Pushed by winterz into branch 'master'.

.clang-tidy - add the pim clang-tidy configuration

A  +76   -0    .clang-tidy

https://invent.kde.org/pim/mailcommon/-/commit/87daca1798809d3e64066e05281db251574ec412

diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 00000000..01bc362a
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,76 @@
+# clang-analyzer-cplusplus.NewDeleteLeaks triggers false-positives in QObject::connect()
+# readability-redundant-access-specifiers triggered by Q_SLOTS
+# readability-inconsistent-declaration-parameter-name trigered by generated Qt code
+# performance-no-automatic-move is triggered by constness of qstring_literal_tmp in QStringLiteral macro
+#
+# TODO make those pass:
+# readability-function-size - for now some tests and the generated code contains extremely long
+#                             functions, which should be split into smaller functions
+
+Checks: -*,
+        bugprone-*,
+        -bugprone-easily-swappable-parameters,
+        -bugprone-implicit-widening-of-multiplication-result,
+        -bugprone-narrowing-conversions,
+        -bugprone-suspicious-include,
+        clang-analyzer-*,
+        -clang-analyzer-apiModeling.*,
+        -clang-analyzer-optin.osx.*,
+        -clang-analyzer-optin.cplusplus.VirtualCall,
+        -clang-analyzer-cplusplus.NewDeleteLeaks,
+        -clang-analyzer-webkit.*,
+        -google-*,
+        misc-*,
+        -misc-definitions-in-headers,
+        -misc-include-cleaner,
+        -misc-multiple-inheritance,
+        -misc-no-recursion,
+        -misc-use-anonymous-namespace,
+        -*-non-private-member-variables-in-classes,
+        performance-*,
+        -performance-enum-size,
+        -performance-no-automatic-move,
+        readability-*,
+        -readability-avoid-const-params-in-decls,
+        -readability-avoid-nested-conditional-operator,
+        -readability-convert-member-functions-to-static,
+        -readability-else-after-return,
+        -readability-function-cognitive-complexity,
+        -readability-function-size,
+        -readability-identifier-length,
+        -readability-implicit-bool-conversion,
+        -readability-magic-numbers,
+        -readability-make-member-function-const,
+        -readability-math-missing-parentheses,
+        -readability-named-parameter,
+        -readability-qualified-auto,
+        -readability-redundant-access-specifiers,
+        -readability-redundant-casting,
+        -readability-simplify-boolean-expr,
+        -readability-static-accessed-through-instance,
+        -readability-use-std-min-max,
+        -readability-use-anyofallof,
+#WarningsAsErrors: bugprone-*,
+#                  clang-*,
+#                  google-*,
+#                  misc-*,
+#                  performance-*,
+#                  readability-*,
+HeaderFilterRegex: '/mailcommon/src/'
+CheckOptions:
+    - key:  bugprone-assert-side-effects.AssertMacros
+      value: 'Q_ASSERT;QVERIFY;QCOMPARE;AKVERIFY'
+    - key:  CheckFunctionCalls
+      value: true
+    - key:  StringCompareLikeFunctions
+      value: 'QString::compare;QString::localeAwareCompare'
+    - key: WarnOnSizeOfIntegerExpression
+      value: 1
+    - key: bugprone-dangling-handle.HandleClasses
+      value: 'std::string_view;QStringView'
+    - key: IgnoreClassesWithAllMemberVariablesBeingPublic
+      value: true
+    - key: VectorLikeClasses
+      value: 'std::vector;QList'
+    - key: misc-override-with-different-visibility.DisallowedVisibilityChange
+      value: widening
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.