[libcxx-commits] [PATCH] D120925: [libc++] Enable more clang-tidy checks and list potential candidates

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 3 11:10:22 PST 2022


philnik created this revision.
philnik added reviewers: ldionne, Quuxplusone, var-const, Mordante.
Herald added a project: All.
philnik requested review of this revision.
Herald added subscribers: libcxx-commits, aheejin.
Herald added a project: libc++.
Herald added a reviewer: libc++.

These are some checks that make sense in libc++ IMO. The checks after `#TODO: investigate these checks` are candidates, but they can't be enabled with some cleanup.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120925

Files:
  libcxx/.clang-tidy


Index: libcxx/.clang-tidy
===================================================================
--- libcxx/.clang-tidy
+++ libcxx/.clang-tidy
@@ -1,2 +1,50 @@
 InheritParentConfig: true
-Checks: '-readability-identifier-naming,-llvm-header-guard,-misc-unconventional-assign-operator,-llvm-else-after-return,-llvm-qualified-auto'
+Checks: >
+  bugprone-copy-constructor-init,
+  bugprone-dangling-handle,
+  bugprone-infinite-loop,
+
+  -llvm-else-after-return,
+  -llvm-header-guard,
+  -llvm-qualified-auto,
+
+  -misc-unconventional-assign-operator,
+
+  modernize-redundant-void-arg,
+
+  readability-duplicate-include,
+  readability-function-cognitive-complexity,
+  readability-function-size,
+  -readability-identifier-naming,
+  readability-misplaced-array-index,
+  readability-redundant-control-flow,
+  readability-redundant-function-ptr-dereference,
+  readability-redundant-preprocessor,
+  readability-simplify-subscript-expr,
+  readability-uniqueptr-delete-release,
+
+CheckOptions:
+  - key:   readability-function-cognitive-complexity.Threshold
+    value: 143 # TODO: bring that number down
+  - key:   readability-function-size.LineThreshold
+    value: 194 # TODO: bring that number down
+
+# TODO: investigate these checks
+# bugprone-branch-clone,
+# bugprone-macro-parentheses,
+# cppcoreguidelines-prefer-member-initializer,
+# modernize-loop-convert,
+# modernize-use-bool-literals,
+# modernize-use-default-member-init,
+# modernize-use-equals-default,
+# modernize-use-equals-delete,
+# modernize-use-nullptr,
+# modernize-use-override,
+# portability-restrict-system-includes,
+# readability-function-cognitive-complexity,
+# readability-implicit-bool-conversion,
+# readability-isolate-declaration,
+# readability-redundant-access-specifiers,
+# readability-redundant-declaration,
+# readability-redundant-member-init,
+# readability-simplify-boolean-expr,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120925.412781.patch
Type: text/x-patch
Size: 1885 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220303/58c24bd1/attachment.bin>


More information about the libcxx-commits mailing list