File
Blob: .clang-tidy
| 1 | --- |
| 2 | # TODO: We currently only enable select clang-tidy checks. While many checks provide little value or |
| 3 | # produce false positives, try to incrementally enable most of them. |
| 4 | # TODO: these checks are in progress of cleaning up |
| 5 | # Note: cppcoreguidelines-noexcept-destructor is designed to detect destructors that are missing |
| 6 | # noexcept. We always use noexcept(false) as per KJ-style, but this check works for our purposes |
| 7 | # too. |
| 8 | Checks: > |
| 9 | bugprone-argument-comment, |
| 10 | bugprone-capturing-this-in-member-variable, |
| 11 | bugprone-dynamic-static-initializers, |
| 12 | bugprone-forward-declaration-namespace, |
| 13 | bugprone-invalid-enum-default-initialization, |
| 14 | bugprone-move-forwarding-reference, |
| 15 | bugprone-return-const-ref-from-parameter, |
| 16 | bugprone-suspicious-*, |
| 17 | -bugprone-suspicious-semicolon, |
| 18 | bugprone-undefined-memory-manipulation, |
| 19 | bugprone-unhandled-self-assignment, |
| 20 | bugprone-unused-raii, |
| 21 | bugprone-use-after-move, |
| 22 | cppcoreguidelines-c-copy-assignment-signature, |
| 23 | cppcoreguidelines-misleading-capture-default-by-value, |
| 24 | cppcoreguidelines-noexcept-destructor, |
| 25 | cppcoreguidelines-prefer-member-initializer, |
| 26 | google-readability-casting, |
| 27 | misc-confusable-identifiers, |
| 28 | misc-header-include-cycle, |
| 29 | misc-redundant-expression, |
| 30 | misc-throw-by-value-catch-by-reference, |
| 31 | misc-unused-alias-decls, |
| 32 | misc-unused-using-decls, |
| 33 | modernize-loop-convert, |
| 34 | modernize-macro-to-enum, |
| 35 | modernize-redundant-void-arg, |
| 36 | modernize-type-traits, |
| 37 | modernize-unary-static-assert, |
| 38 | modernize-use-bool-literals, |
| 39 | modernize-use-constraints, |
| 40 | modernize-use-emplace, |
| 41 | modernize-use-equals-delete, |
| 42 | modernize-use-nullptr, |
| 43 | modernize-use-string-view, |
| 44 | modernize-use-transparent-functors, |
| 45 | modernize-use-using, |
| 46 | performance-*, |
| 47 | -performance-enum-size, |
| 48 | -performance-no-int-to-ptr, |
| 49 | -performance-noexcept-move-constructor, |
| 50 | -performance-noexcept-swap, |
| 51 | -performance-unnecessary-value-param, |
| 52 | readability-avoid-const-params-in-decls, |
| 53 | readability-container-contains, |
| 54 | readability-container-size-empty, |
| 55 | readability-delete-null-pointer, |
| 56 | readability-duplicate-include, |
| 57 | readability-enum-initial-value, |
| 58 | readability-redundant-*, |
| 59 | -readability-redundant-inline-specifier, |
| 60 | -readability-redundant-parentheses, |
| 61 | -readability-redundant-smartptr-get, |
| 62 | readability-reference-to-constructed-temporary, |
| 63 | readability-static-accessed-through-instance, |
| 64 | readability-use-concise-preprocessor-directives |
| 65 | |
| 66 | # TODO: Fix and enable |
| 67 | # bugprone-derived-method-shadowing-base-method |
| 68 | # bugprone-parent-virtual-call |
| 69 | # cppcoreguidelines-interfaces-global-init |
| 70 | # cppcoreguidelines-missing-std-forward |
| 71 | # cppcoreguidelines-pro-type-member-init |
| 72 | # modernize-use-equals-default |
| 73 | # modernize-use-override |
| 74 | # modernize-use-ranges |
| 75 | # readability-avoid-return-with-void-value |
| 76 | # modernize-avoid-variadic-functions |
| 77 | # readability-convert-member-functions-to-static |
| 78 | # readability-redundant-smartptr-get |
| 79 | # readability-use-anyofallof |
| 80 | |
| 81 | WarningsAsErrors: '*' |
| 82 | HeaderFilterRegex: '.*src/workerd/.*' |
| 83 | |
| 84 | CheckOptions: |
| 85 | # JSG has very entrenched include cycles |
| 86 | - key: misc-header-include-cycle.IgnoredFilesList |
| 87 | value: "jsg/jsg.h|jsg/dom-exception.h" |
| 88 | - key: cppcoreguidelines-missing-std-forward.ForwardFunction |
| 89 | value: "kj::fwd" |