Skip to content

Commit 3e49d17

Browse files
RSNarafacebook-github-bot
authored andcommitted
Fix clang tidy for react-native (#51679)
Summary: Pull Request resolved: #51679 ## Problem I noticed that clang-tidy was crashing in some of our native modules. This diff fixes the crash. And it blocklists all the warnings that got raised when I ran clang tidy for react native. ## Fix This rule would crash clang tidy: ``` cppcoreguidelines-avoid-const-or-ref-data-members ``` I disabled it in the .clang-tidy file via: ``` -clang-analyzer-*, ``` ## Why disable existing warnings? We need to double check which checks make sense to enable for react native github. Until we have that understanding, I don't think we should prompt people to adjust their code. After we have that understanding, it should be really easy to enable the checks: just run the linter on react native, and fix the code. Reviewed By: lunaleaps Differential Revision: D75596329 fbshipit-source-id: 757a8d38f203d7fb4403bbda3703fda7b44923b0
1 parent 25f8b86 commit 3e49d17

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

.clang-tidy

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# The following checks should be kept disabled:
2+
# clang-analyzer-*: Broken/unreliable
3+
# readability-simplify-boolean-expr: Broken
4+
# cppcoreguidelines-*: Only recommented for new code-bases
5+
# cert-err58-cpp: Deemed low-value. See ERR58-CPP for more info.
6+
# performance-unnecessary-value-param: Is not up to date
7+
#
8+
# T225851676: Do a sweep over the remaining checks. Turn them on,
9+
# if they make sense. And fix the code.
10+
---
11+
InheritParentConfig: true
12+
Checks: '
13+
-bugprone-exception-escape,
14+
-bugprone-macro-parentheses,
15+
-cert-err58-cpp,
16+
-clang-analyzer-*,
17+
-clang-diagnostic-deprecated-declarations,
18+
-clang-diagnostic-error,
19+
-clang-diagnostic-missing-designated-field-initializers,
20+
-clang-diagnostic-objc-designated-initializers,
21+
-clang-diagnostic-unguarded-availability-new,
22+
-clang-diagnostic-vla-cxx-extension,
23+
-cppcoreguidelines-*,
24+
-google-build-using-namespace,
25+
-lint-command-empty-cdb,
26+
-lint-command-empty-cdb,
27+
-misc-header-include-cycle,
28+
-misc-misplaced-const,
29+
-misc-unused-parameters,
30+
-modernize-avoid-c-arrays,
31+
-modernize-deprecated-headers,
32+
-modernize-loop-convert,
33+
-modernize-make-shared,
34+
-modernize-pass-by-value,
35+
-modernize-raw-string-literal,
36+
-modernize-redundant-void-arg,
37+
-modernize-return-braced-init-list,
38+
-modernize-use-auto,
39+
-modernize-use-designated-initializers,
40+
-modernize-use-emplace,
41+
-modernize-use-equals-default,
42+
-modernize-use-nullptr,
43+
-modernize-use-override,
44+
-modernize-use-using,
45+
-performance-for-range-copy,
46+
-performance-move-const-arg,
47+
-performance-no-int-to-ptr,
48+
-performance-unnecessary-copy-initialization,
49+
-performance-unnecessary-value-param,
50+
-readability-avoid-const-params-in-decls,
51+
-readability-braces-around-statements,
52+
-readability-const-return-type,
53+
-readability-container-size-empty,
54+
-readability-implicit-bool-conversion,
55+
-readability-inconsistent-declaration-parameter-name,
56+
-readability-isolate-declaration,
57+
-readability-named-parameter,
58+
-readability-operators-representation,
59+
-readability-redundant-declaration,
60+
-readability-simplify-boolean-expr,
61+
-readability-static-definition-in-anonymous-namespace,
62+
'

0 commit comments

Comments
 (0)