summaryrefslogtreecommitdiff
path: root/.clang-tidy
blob: 55e1f15028ed65c3c0828b11706717a19d88b7fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
# Globally Disabled checks:
#
# bugprone-easily-swappable-parameters: This warning is loud with no clear advice on how to fix the potential problem
# FIXME: bugprone-macro-parentheses: Enable with clang-tidy-14 when NOLINTBEGIN/NOLINTEND are available for code generating macros
# bugprone-reserved-identifier: LibC headers that show up in the header filter are part of "the implementation"
#   cert-dcl37-c: Alias for bugprone-reserved-identifier
#   cert-dcl51-cpp: Alias for bugprone-reserved-identifier
# cert-dcl21-cpp: No reference to this rule exists on Carnegie Mellon's SEI CERT C++ Confluence. And the suggestion is unusual
# FIXME: misc-non-private-member-variables-in-classes: Audit uses of protected member variables to see if they really need to be protected
# performance-noexcept-move-constructor: The project does not use exceptions, so there are no such optimizations available
# performance-no-int-to-ptr: This rule flags every pointer to integer cast, which gets quite noisy. Should only be enabled on a case-by-case basis
# readability-braces-around-statements: Redundant braces around single-line conditions is against project style
# readability-magic-numbers: This check is very noisy in the codebase, especially in AK.
# readability-named-parameter: We frequently omit parameter names to work around -Wunused-parameter
# FIXME: readability-uppercase-literal-suffix: Enable this check, the rationale is solid but the findings are numerous
#
Checks: >
  -*,
  bugprone-*,
  cert-*,
  clang-analyzer-*,
  concurrency-*,
  misc-*,
  performance-*,
  portability-*,
  readability-*,
  -bugprone-easily-swappable-parameters,
  -bugprone-macro-parentheses,
  -bugprone-reserved-identifier,-cert-dcl37-c,-cert-dcl51-cpp,
  -cert-dcl21-cpp,
  -misc-non-private-member-variables-in-classes,
  -performance-noexcept-move-constructor,
  -performance-no-int-to-ptr,
  -readability-braces-around-statements,
  -readability-identifier-length,
  -readability-magic-numbers,
  -readability-named-parameter,
  -readability-uppercase-literal-suffix,
  -readability-use-anyofallof,
WarningsAsErrors: ''
HeaderFilterRegex: 'AK|Userland|Kernel|Tests'
FormatStyle: none
CheckOptions:
  - key: bugprone-dangling-handle.HandleClasses
    value: 'AK::StringView;AK::Span'
  - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
    value: true
  - key: readability-implicit-bool-conversion.AllowPointerConditions
    value: true
  - key: readability-function-cognitive-complexity.Threshold
    value: 100 # FIXME: Lower this (30? 50?), and refactor complex functions