Skip to content

Commit 51af7cd

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
Use nested namespace name
Summary: changelog: [internal] Enable two new clang tidy checks: - modernize-concat-nested-namespaces - google-build-using-namespace jest_e2e[run_all_tests] Reviewed By: rshest Differential Revision: D40020646 fbshipit-source-id: f3be80b5f829dd0ba376bdd70ed13332e114d48a
1 parent 9715993 commit 51af7cd

File tree

141 files changed

+301
-575
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+301
-575
lines changed

ReactCommon/react/renderer/.clang-tidy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Checks: '>
44
clang-diagnostic-*,
55
modernize-avoid-bind,
66
modernize-avoid-c-arrays,
7+
modernize-concat-nested-namespaces,
78
modernize-deprecated-headers,
89
modernize-deprecated-ios-base-aliases,
910
modernize-loop-convert,
@@ -182,5 +183,6 @@ clang-analyzer-unix.cstring.NullArg,
182183
clang-analyzer-valist.CopyToSelf,
183184
clang-analyzer-valist.Uninitialized,
184185
clang-analyzer-valist.Unterminated,
186+
google-build-using-namespace,
185187
'
186188
...

ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
#include <react/renderer/animations/utils.h>
1313
#include <algorithm>
1414

15-
namespace facebook {
16-
namespace react {
15+
namespace facebook::react {
1716

1817
void LayoutAnimationDriver::animationMutationsForFrame(
1918
SurfaceId surfaceId,
@@ -107,5 +106,4 @@ void LayoutAnimationDriver::animationMutationsForFrame(
107106
&shouldFirstComeBeforeSecondMutation);
108107
}
109108

110-
} // namespace react
111-
} // namespace facebook
109+
} // namespace facebook::react

ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030

3131
#include <glog/logging.h>
3232

33-
namespace facebook {
34-
namespace react {
33+
namespace facebook::react {
3534

3635
#ifdef LAYOUT_ANIMATION_VERBOSE_LOGGING
3736
static std::string GetMutationInstructionString(
@@ -1683,5 +1682,4 @@ void LayoutAnimationKeyFrameManager::simulateImagePropsMemoryAccess(
16831682
}
16841683
}
16851684

1686-
} // namespace react
1687-
} // namespace facebook
1685+
} // namespace facebook::react

ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232

3333
MockClock::time_point MockClock::time_ = {};
3434

35-
namespace facebook {
36-
namespace react {
35+
namespace facebook::react {
3736

3837
static void testShadowNodeTreeLifeCycleLayoutAnimations(
3938
uint_fast32_t seed,
@@ -309,8 +308,7 @@ static void testShadowNodeTreeLifeCycleLayoutAnimations(
309308
SUCCEED();
310309
}
311310

312-
} // namespace react
313-
} // namespace facebook
311+
} // namespace facebook::react
314312

315313
using namespace facebook::react;
316314

ReactCommon/react/renderer/animations/utils.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
#include "utils.h"
99
#include <cmath>
1010

11-
namespace facebook {
12-
namespace react {
11+
namespace facebook::react {
1312

1413
std::pair<Float, Float> calculateAnimationProgress(
1514
uint64_t now,
@@ -67,5 +66,4 @@ std::pair<Float, Float> calculateAnimationProgress(
6766
}
6867
}
6968

70-
} // namespace react
71-
} // namespace facebook
69+
} // namespace facebook::react

ReactCommon/react/renderer/attributedstring/AttributedString.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010
#include <react/renderer/debug/DebugStringConvertibleItem.h>
1111

12-
namespace facebook {
13-
namespace react {
12+
namespace facebook::react {
1413

1514
using Fragment = AttributedString::Fragment;
1615
using Fragments = AttributedString::Fragments;
@@ -166,5 +165,4 @@ SharedDebugStringConvertibleList AttributedString::getDebugChildren() const {
166165
}
167166
#endif
168167

169-
} // namespace react
170-
} // namespace facebook
168+
} // namespace facebook::react

ReactCommon/react/renderer/attributedstring/AttributedStringBox.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212
#include <utility>
1313

14-
namespace facebook {
15-
namespace react {
14+
namespace facebook::react {
1615

1716
AttributedStringBox::AttributedStringBox()
1817
: mode_(Mode::Value),
@@ -86,5 +85,4 @@ bool operator!=(
8685
return !(lhs == rhs);
8786
}
8887

89-
} // namespace react
90-
} // namespace facebook
88+
} // namespace facebook::react

ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
#include <react/renderer/graphics/conversions.h>
1313
#include <react/utils/FloatComparison.h>
1414

15-
namespace facebook {
16-
namespace react {
15+
namespace facebook::react {
1716

1817
bool ParagraphAttributes::operator==(const ParagraphAttributes &rhs) const {
1918
return std::tie(
@@ -55,5 +54,4 @@ SharedDebugStringConvertibleList ParagraphAttributes::getDebugProps() const {
5554
}
5655
#endif
5756

58-
} // namespace react
59-
} // namespace facebook
57+
} // namespace facebook::react

ReactCommon/react/renderer/attributedstring/TextAttributes.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515

1616
#include <react/renderer/debug/debugStringConvertibleUtils.h>
1717

18-
namespace facebook {
19-
namespace react {
18+
namespace facebook::react {
2019

2120
void TextAttributes::apply(TextAttributes textAttributes) {
2221
// Color
@@ -208,5 +207,4 @@ SharedDebugStringConvertibleList TextAttributes::getDebugProps() const {
208207
}
209208
#endif
210209

211-
} // namespace react
212-
} // namespace facebook
210+
} // namespace facebook::react

ReactCommon/react/renderer/attributedstring/tests/AttributedStringBoxTest.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
#include <gtest/gtest.h>
1111
#include <react/renderer/attributedstring/AttributedStringBox.h>
1212

13-
namespace facebook {
14-
namespace react {
13+
namespace facebook::react {
1514

1615
TEST(AttributedStringBoxTest, testDefaultConstructor) {
1716
auto attributedStringBox = AttributedStringBox{};
@@ -101,5 +100,4 @@ TEST(AttributedStringBoxTest, testMoveAssignment) {
101100
}
102101
}
103102

104-
} // namespace react
105-
} // namespace facebook
103+
} // namespace facebook::react

ReactCommon/react/renderer/attributedstring/tests/ParagraphAttributesTest.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
#include <react/renderer/attributedstring/conversions.h>
1111
#include <react/renderer/attributedstring/primitives.h>
1212

13-
namespace facebook {
14-
namespace react {
13+
namespace facebook::react {
1514

1615
#ifdef ANDROID
1716

@@ -32,5 +31,4 @@ TEST(ParagraphAttributesTest, testToDynamic) {
3231

3332
#endif
3433

35-
} // namespace react
36-
} // namespace facebook
34+
} // namespace facebook::react

ReactCommon/react/renderer/componentregistry/ComponentDescriptorProviderRegistry.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
#include "ComponentDescriptorProviderRegistry.h"
99

10-
namespace facebook {
11-
namespace react {
10+
namespace facebook::react {
1211

1312
void ComponentDescriptorProviderRegistry::add(
1413
const ComponentDescriptorProvider &provider) const {
@@ -81,5 +80,4 @@ ComponentDescriptorProviderRegistry::createComponentDescriptorRegistry(
8180
return registry;
8281
}
8382

84-
} // namespace react
85-
} // namespace facebook
83+
} // namespace facebook::react

ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
#include <utility>
1818

19-
namespace facebook {
20-
namespace react {
19+
namespace facebook::react {
2120

2221
ComponentDescriptorRegistry::ComponentDescriptorRegistry(
2322
ComponentDescriptorParameters parameters,
@@ -160,5 +159,4 @@ ComponentDescriptorRegistry::getFallbackComponentDescriptor() const {
160159
return _fallbackComponentDescriptor;
161160
}
162161

163-
} // namespace react
164-
} // namespace facebook
162+
} // namespace facebook::react

ReactCommon/react/renderer/componentregistry/componentNameByReactViewName.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
#include "componentNameByReactViewName.h"
99

10-
namespace facebook {
11-
namespace react {
10+
namespace facebook::react {
1211

1312
std::string componentNameByReactViewName(std::string viewName) {
1413
// We need this function only for the transition period;
@@ -69,5 +68,4 @@ std::string componentNameByReactViewName(std::string viewName) {
6968
return viewName;
7069
}
7170

72-
} // namespace react
73-
} // namespace facebook
71+
} // namespace facebook::react

ReactCommon/react/renderer/componentregistry/native/NativeComponentRegistryBinding.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212

1313
using namespace facebook;
1414

15-
namespace facebook {
16-
namespace react {
15+
namespace facebook::react {
1716

1817
/**
1918
* Public API to install the NativeComponentRegistryBinding.
@@ -49,7 +48,7 @@ bool NativeComponentRegistryBinding::hasComponent(const std::string &name) {
4948

5049
jsi::Value NativeComponentRegistryBinding::jsProxy(
5150
jsi::Runtime &runtime,
52-
const jsi::Value &thisVal,
51+
const jsi::Value & /*thisVal*/,
5352
const jsi::Value *args,
5453
size_t count) {
5554
if (count != 1) {
@@ -64,5 +63,4 @@ jsi::Value NativeComponentRegistryBinding::jsProxy(
6463
return {result};
6564
}
6665

67-
} // namespace react
68-
} // namespace facebook
66+
} // namespace facebook::react

ReactCommon/react/renderer/components/image/ImageEventEmitter.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
#include "ImageEventEmitter.h"
99

10-
namespace facebook {
11-
namespace react {
10+
namespace facebook::react {
1211

1312
void ImageEventEmitter::onLoadStart() const {
1413
dispatchEvent("loadStart");
@@ -38,5 +37,4 @@ void ImageEventEmitter::onPartialLoad() const {
3837
dispatchEvent("partialLoad");
3938
}
4039

41-
} // namespace react
42-
} // namespace facebook
40+
} // namespace facebook::react

ReactCommon/react/renderer/components/image/ImageProps.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
#include <react/renderer/core/CoreFeatures.h>
1111
#include <react/renderer/core/propsConversions.h>
1212

13-
namespace facebook {
14-
namespace react {
13+
namespace facebook::react {
1514

1615
ImageProps::ImageProps(
1716
const PropsParserContext &context,
@@ -99,5 +98,4 @@ void ImageProps::setProp(
9998
}
10099
}
101100

102-
} // namespace react
103-
} // namespace facebook
101+
} // namespace facebook::react

ReactCommon/react/renderer/components/image/ImageShadowNode.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
#include <react/renderer/core/LayoutContext.h>
1313
#include "ImageState.h"
1414

15-
namespace facebook {
16-
namespace react {
15+
namespace facebook::react {
1716

1817
const char ImageComponentName[] = "Image";
1918

@@ -94,5 +93,4 @@ void ImageShadowNode::layout(LayoutContext layoutContext) {
9493
ConcreteViewShadowNode::layout(layoutContext);
9594
}
9695

97-
} // namespace react
98-
} // namespace facebook
96+
} // namespace facebook::react

ReactCommon/react/renderer/components/image/ImageState.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
#include "ImageState.h"
99

10-
namespace facebook {
11-
namespace react {
10+
namespace facebook::react {
1211

1312
ImageSource ImageState::getImageSource() const {
1413
return imageSource_;
@@ -22,5 +21,4 @@ Float ImageState::getBlurRadius() const {
2221
return blurRadius_;
2322
}
2423

25-
} // namespace react
26-
} // namespace facebook
24+
} // namespace facebook::react

ReactCommon/react/renderer/components/modal/ModalHostViewShadowNode.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
#include <react/renderer/components/modal/ModalHostViewShadowNode.h>
1111
#include <react/renderer/core/LayoutContext.h>
1212

13-
namespace facebook {
14-
namespace react {
13+
namespace facebook::react {
1514

1615
extern const char ModalHostViewComponentName[] = "ModalHostView";
1716

18-
} // namespace react
19-
} // namespace facebook
17+
} // namespace facebook::react

ReactCommon/react/renderer/components/modal/ModalHostViewState.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
#include "ModalHostViewState.h"
99

10-
namespace facebook {
11-
namespace react {
10+
namespace facebook::react {
1211

1312
#ifdef ANDROID
1413
folly::dynamic ModalHostViewState::getDynamic() const {
@@ -17,5 +16,4 @@ folly::dynamic ModalHostViewState::getDynamic() const {
1716
}
1817
#endif
1918

20-
} // namespace react
21-
} // namespace facebook
19+
} // namespace facebook::react

ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
using namespace facebook::jni;
1515

16-
namespace facebook {
17-
namespace react {
16+
namespace facebook::react {
1817

1918
Size AndroidProgressBarMeasurementsManager::measure(
2019
SurfaceId surfaceId,
@@ -71,5 +70,4 @@ Size AndroidProgressBarMeasurementsManager::measure(
7170
return measurement;
7271
}
7372

74-
} // namespace react
75-
} // namespace facebook
73+
} // namespace facebook::react

ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarShadowNode.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
#include <react/renderer/components/progressbar/AndroidProgressBarShadowNode.h>
1111
#include <react/renderer/core/LayoutContext.h>
1212

13-
namespace facebook {
14-
namespace react {
13+
namespace facebook::react {
1514

1615
extern const char AndroidProgressBarComponentName[] = "AndroidProgressBar";
1716

@@ -31,5 +30,4 @@ Size AndroidProgressBarShadowNode::measureContent(
3130
getSurfaceId(), getConcreteProps(), layoutConstraints);
3231
}
3332

34-
} // namespace react
35-
} // namespace facebook
33+
} // namespace facebook::react

0 commit comments

Comments
 (0)