mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
9c0edaec92
Summary:
Inspired by some new C++ code in `RKJSModules` where Clang Tidy could have caught some C++ quirks and shown them in Phabricator, this enables Fabric's Clang Tidy checks in more places, and enables more checks.
1. Hoist the renderer `.clang-tidy` to `xplat/js`, and duplicate to `xplat/ReactNative`
2. Remove all the scattered `.clang-tidy` files in RN which are less aggressive
3. Sort the list of checks
4. Add the following new checks:
1. `bugprone-incorrect-enable-if`
1. `bugprone-infinite-loop`
1. `bugprone-optional-value-conversion`
1. `bugprone-redundant-branch-condition`
1. `bugprone-shared-ptr-array-mismatch`
1. `bugprone-signed-char-misuse`
1. `bugprone-too-small-loop-variable`
1. `bugprone-unique-ptr-array-mismatch`
1. `bugprone-unsafe-functions`
1. `bugprone-unused-raii`
1. `cppcoreguidelines-avoid-const-or-ref-data-members`
1. `cppcoreguidelines-avoid-non-const-global-variables`
1. `cppcoreguidelines-init-variables`
1. `cppcoreguidelines-interfaces-global-init`
1. `cppcoreguidelines-missing-std-forward`
1. `cppcoreguidelines-prefer-member-initializer`
1. `facebook-hte-BadEnum`
1. `facebook-hte-MissingStatic`
1. `misc-header-include-cycle`
1. `misc-misplaced-const`
1. `modernize-use-constraints`
1. `modernize-use-designated-initializers`
1. `modernize-use-starts-ends-with`
I did not auto apply fixes, since even the existing set can sometimes (rarely) generate invalid code.
Changelog: [Internal]
Reviewed By: ksheedlo
Differential Revision: D54411398
fbshipit-source-id: 4958d880969ae07a03fa4f62ba68ee44790487ca