1+ ---
2+ # clang-tidy configuration
3+ #
4+ # clang-tidy can be run manually like this:
5+ #
6+ # run-clang-tidy -p build 'Source.*'
7+ #
8+ # To apply fixes suggested by clang-tidy, run:
9+ #
10+ # run-clang-tidy -p build -fix -format 'Source.*'
11+ #
12+ # To limit the run to certain checks:
13+ #
14+ # run-clang-tidy -checks='-*,modernize-use-nullptr' -p build 'Source.*'
15+ #
16+ # clang-tidy also has several IDE integrations listed here:
17+ # https://clang.llvm.org/extra/clang-tidy/Integrations.html
18+
19+ # Enable most checks.
20+ #
21+ # Built-in checks:
22+ # https://clang.llvm.org/extra/clang-tidy/checks/list.html
23+ #
24+ # Exclusions:
25+ #
26+ # -modernize-avoid-c-arrays
27+ # We use C-arrays throughout, e.g. for `constexpr char []`.
28+ # `std::array` is not a replacement because its length is
29+ # not deduced.
30+ #
31+ # -modernize-use-trailing-return-type
32+ # A purely stylistic change that we do not want.
33+ #
34+ # -modernize-concat-nested-namespaces
35+ # -modernize-avoid-bind
36+ # Compatibility with older compilers.
37+ Checks : >
38+ -*,
39+ bugprone-*,
40+ cppcoreguidelines-pro-type-cstyle-cast,
41+ google-runtime-int,
42+ llvm-include-order,
43+ llvm-namespace-comment,
44+ misc-*,
45+ modernize-*,
46+ performance-*,
47+ portability-*,
48+ readability-*,
49+ -readability-identifier-length,
50+ -bugprone-easily-swappable-parameters,
51+ -readability-magic-numbers,
52+ -misc-non-private-member-variables-in-classes,
53+ -modernize-avoid-c-arrays,
54+ -modernize-use-trailing-return-type,
55+ -modernize-concat-nested-namespaces,
56+ -modernize-avoid-bind,
57+ -modernize-use-constraints
58+
59+ HeaderFilterRegex : " ^(Source|test)\\ .h$"
60+
61+ CheckOptions :
62+ - { key: readability-identifier-naming.NamespaceCase, value: lower_case }
63+ - { key: readability-identifier-naming.ClassCase, value: CamelCase }
64+ - { key: readability-identifier-naming.StructCase, value: CamelCase }
65+ - { key: readability-identifier-naming.TemplateParameterCase, value: CamelCase }
66+ - { key: readability-identifier-naming.MethodCase, value: camelBack }
67+ - { key: readability-identifier-naming.FunctionCase, value: CamelCase }
68+ - { key: readability-identifier-naming.ParameterCase, value: camelBack }
69+ - { key: readability-identifier-naming.MemberCase, value: camelBack }
70+ - { key: readability-identifier-naming.VariableCase, value: camelBack }
71+ - { key: readability-identifier-naming.ClassMemberCase, value: lower_case }
72+ - { key: readability-identifier-naming.GlobalVariableCase, value: aNy_CasE }
73+ - { key: readability-identifier-naming.GlobalFunctionCase, value: aNy_CasE }
74+ - { key: readability-identifier-naming.ClassMemberSuffix, value: _ }
75+ - { key: readability-identifier-naming.PrivateMemberSuffix, value: _ }
76+ - { key: readability-identifier-naming.ProtectedMemberSuffix, value: _ }
77+ - { key: readability-identifier-naming.EnumConstantCase, value: CamelCase }
78+ - { key: readability-identifier-naming.ConstexprVariableCase, value: CamelCase }
79+ - { key: readability-identifier-naming.GlobalConstantCase, value: CamelCase }
80+ - { key: readability-identifier-naming.MemberConstantCase, value: CamelCase }
81+ - { key: readability-identifier-naming.StaticConstantCase, value: CamelCase }
82+
83+ # Allow short if-statements without braces
84+ - { key: readability-braces-around-statements.ShortStatementLines, value: 3 }
85+
86+ # Use <cstdint> fixed-width integer types instead of short, long and long long
87+ - { key: google-runtime-int.UnsignedTypePrefix, value: "std::uint" }
88+ - { key: google-runtime-int.SignedTypePrefix, value: "std::int" }
89+ - { key: google-runtime-int.TypeSuffix, value: "_t" }
90+
91+ # `int8_t` aren't used as chars, disable misleading warning.
92+ - { key: bugprone-signed-char-misuse.CharTypdefsToIgnore, value: "std::int8_t" }
93+
94+ - { key: readability-identifier-length.MinimumLoopCounterNameLength, value: 1 }
95+
96+ # Ignore warnings for individual SDL headers, e.g. SDL_video.h, SDL_render.h
97+ - { key: misc-include-cleaner.IgnoreHeaders, value: 'SDL_.*\.h' }
0 commit comments