xref: /openbmc/docs/style/cpp/.clang-tidy (revision 12cf111b6a041843bc3a2ba04696471d4301bbb7)
15ae48158SAlexander HansenChecks: '
25ae48158SAlexander Hansen    -*,
390629cc4SLei YU    bugprone-unchecked-optional-access,
4*12cf111bSJayanth Othayoth    modernize-use-nullptr,
55ae48158SAlexander Hansen    readability-function-size,
65ae48158SAlexander Hansen    readability-function-cognitive-complexity
75ae48158SAlexander Hansen'
85ae48158SAlexander HansenCheckOptions:
95ae48158SAlexander Hansen  - { key: readability-function-size.LineThreshold,             value: 60 } # [1]
105ae48158SAlexander Hansen  - { key: readability-function-size.ParameterThreshold,        value: 6 }  # [2]
115ae48158SAlexander Hansen  - { key: readability-function-cognitive-complexity.Threshold, value: 25 } # [3]
125ae48158SAlexander Hansen
13e6185cf8SPatrick WilliamsWarningsAsErrors: '*'
14278f19d4SAlexander HansenHeaderFilterRegex: '(?!^subprojects).*'
15e6185cf8SPatrick Williams
165ae48158SAlexander Hansen# [1] https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#f3-keep-functions-short-and-simple
175ae48158SAlexander Hansen# [2] https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#f2-a-function-should-perform-a-single-logical-operation
185ae48158SAlexander Hansen# [3] https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#f3-keep-functions-short-and-simple
195ae48158SAlexander Hansen# However cognitive complexity != cyclomatic complexity. Therefore using the clang-tidy default value,
205ae48158SAlexander Hansen# as cyclomatic complexity seems to not be implemented in clang-tidy.
215ae48158SAlexander Hansen
225ae48158SAlexander Hansen# [1],[2],[3] do not have to be enforced or applied project-wide yet.
23