[pim/libksieve] /: .clang-tidy - add clang-tidy configuration

Allen Winter <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 651d438588d6423bf0815313718509433bf09cd3 by Allen Winter.
Committed on 28/07/2026 at 15:13.
Pushed by winterz into branch 'master'.

.clang-tidy - add clang-tidy configuration

A  +77   -0    .clang-tidy
M  +1    -1    REUSE.toml

https://invent.kde.org/pim/libksieve/-/commit/651d438588d6423bf0815313718509433bf09cd3

diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 00000000..93f0d997
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,77 @@
+# 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-concise-preprocessor-directives,
+        -readability-use-std-min-max,
+        -readability-use-anyofallof,
+#WarningsAsErrors: bugprone-*,
+#                  clang-*,
+#                  google-*,
+#                  misc-*,
+#                  performance-*,
+#                  readability-*,
+HeaderFilterRegex: '/libksieve/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
diff --git a/REUSE.toml b/REUSE.toml
index 8a506561..e562bb59 100644
--- a/REUSE.toml
+++ b/REUSE.toml
@@ -6,7 +6,7 @@ SPDX-PackageSupplier = "Montel Laurent <[email protected]>"
 SPDX-PackageDownloadLocation = "https://invent.kde.org/pim/libksieve"
 
 [[annotations]]
[suppressed due to size limit]
[suppressed due to size limit]
 precedence = "aggregate"
 SPDX-FileCopyrightText = "none"
 SPDX-License-Identifier = "CC0-1.0"
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.