forked from facebookresearch/habitat-sim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-tidy
127 lines (123 loc) · 4.88 KB
/
.clang-tidy
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
Checks: '
bugprone-*,
clang-analyzer-cplusplus-*,
clang-analyzer-optin.performance.*,
cppcoreguidelines-init-variables,
cppcoreguidelines-pro-type-member-init,
google-*,
misc-definitions-in-headers,
misc-static-assert,
misc-unconventional-assign-operator,
misc-uniqueptr-reset-release,
misc-unused-parameters,
modernize-avoid-bind,
modernize-deprecated-headers,
modernize-make-shared,
modernize-make-unique,
modernize-pass-by-value,
modernize-redundant-void-arg,
modernize-replace-disallow-copy-and-assign-macro,
modernize-replace-random-shuffle,
modernize-shrink-to-fit,
modernize-unary-static-assert,
modernize-use-bool-literals,
modernize-use-default-member-init,
modernize-use-emplace,
modernize-use-equals-default,
modernize-use-equals-delete,
modernize-use-noexcept,
modernize-use-nullptr,
modernize-use-override,
modernize-use-transparent-functors,
performance-*,
readability-avoid-const-params-in-decls,
readability-const-return-type,
readability-delete-null-pointer,
readability-implicit-bool-conversion,
readability-make-member-function-const,
readability-misplaced-array-index,
readability-non-const-parameter,
readability-qualified-auto,
readability-redundant-declaration,
readability-redundant-function-ptr-dereference,
readability-redundant-preprocessor,
readability-redundant-smartptr-get,
readability-redundant-string-cstr,
readability-simplify-boolean-expr,
readability-simplify-subscript-expr,
readability-static-accessed-through-instance,
readability-static-definition-in-anonymous-namespace,
readability-string-compare,
readability-uniqueptr-delete-release,
-*-objc-*,
-*.cocoa.*,
-clang-analyzer-core.NullDereference,
-clang-analyzer-security.insecureAPI.rand,
-google-build-explicit-make-pair,
-google-default-arguments,
-google-readability-braces-around-statements,
-google-readability-todo,
-google-runtime-references,
-modernize-avoid-c-arrays,
-modernize-use-auto,
-modernize-use-trailing-return-type,
-bugprone-easily-swappable-parameters,
-bugprone-forward-declaration-namespace,
-performance-no-int-to-ptr,
'
CheckOptions:
- key: cppcoreguidelines-pro-type-member-init.IgnoreArrays
value: true
- key: modernize-pass-by-value.ValuesOnly
value: true
- key: performance-for-range-copy.WarnOnAllAutoCopies
value: true
- key: readability-implicit-bool-conversion.AllowPointerConditions
value: true
WarningsAsErrors: '
*,
-bugprone-narrowing-conversions,
-bugprone-reserved-identifier,
-bugprone-unused-raii,
-clang-diagnostic-deprecated-declarations,
-clang-analyzer-cplusplus.PlacementNew,
-cppcoreguidelines-pro-type-member-init,
-optin.cplusplus.UninitializedObject,
-readability-implicit-bool-conversion,
'
HeaderFilterRegex: "src/esp/"
# Comments for particular disabled checks:
#
# bugprone-forward-declaration-namespace
# This check would make forward declarations work only if each class name is
# unique across all namespaces, otherwise it would complain that e.g. Buffer
# is defined in Magnum::GL but a forward declaration appears in Magnum::Vk.
# Which is just useless, and goes against the point of namespaces.
# clang-diagnostic-deprecated-declarations
# From time to time, Magnum annotates APIs with deprecation warnings,
# suggesting people to upgrade to newer / better designed / more flexible
# APIs. Treating such warnings as error is counterproductive, since the first
# thing you want to do after an upgrade is compiling existing *unchanged*
# code and ensuring all tests pass, and only then start updating the code.
# readability-implicit-bool-conversion
# There's many cases of checking counts in if statements, such as
# `if(!importer->sceneCount())` for Magnum importers. For those there are no
# corresponding `hasScenes()` or such, and having to write `== 0` doesn't
# really improve readability in any way. Keeping this as a warning tho, as it
# *might* actually be useful in certain cases, just not treating it as an
# error.
# performance-no-int-to-ptr
# "error: integer to pointer cast pessimizes optimization opportunities"
# triggered by gfx::replay::NodeHandle, which can be either a pointer (for
# the SceneGraph backend) or an arbitrary integer value (for the new
# data-oriented backend). Clang Tidy, tell me, how else am I supposed to
# implement type-safe handles?!
# misc-misplaced-const
# "'node' declared with a const-qualified typedef; results in the type being
# 'esp::gfx::replay::NodeHandle_ *const' instead of 'const
# esp::gfx::replay::NodeHandle_ *'". Same problem, how else am I supposed to
# implement type-safe handles? If the handle represents an integer, it's also
# not really "const" because I can use it to index a mutable array (which I
# regularly do). "Fixing" this warning would mean adding a const to the
# typedef AND THEN a const_cast to each and every reinterpret_cast that turns
# it into a SceneNode*. Which is way worse than the original problem.