From 87fdd2ef3957e4d439927544aa2b7963095f797e Mon Sep 17 00:00:00 2001 From: CodemodService Bot Date: Fri, 20 Jun 2025 03:44:34 -0700 Subject: [PATCH] Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/cxxreact Reviewed By: javache Differential Revision: D77014011 --- packages/react-native/ReactCommon/cxxreact/CxxModule.h | 8 ++------ .../react-native/ReactCommon/cxxreact/JsArgumentHelpers.h | 6 ++---- .../react-native/ReactCommon/cxxreact/ReactMarker.cpp | 6 ++---- packages/react-native/ReactCommon/cxxreact/ReactMarker.h | 6 ++---- .../react-native/ReactCommon/cxxreact/SampleCxxModule.cpp | 8 ++------ .../react-native/ReactCommon/cxxreact/SampleCxxModule.h | 8 ++------ .../ReactCommon/cxxreact/SharedProxyCxxModule.h | 8 ++------ 7 files changed, 14 insertions(+), 36 deletions(-) diff --git a/packages/react-native/ReactCommon/cxxreact/CxxModule.h b/packages/react-native/ReactCommon/cxxreact/CxxModule.h index 45239625854..7e767f145ef 100644 --- a/packages/react-native/ReactCommon/cxxreact/CxxModule.h +++ b/packages/react-native/ReactCommon/cxxreact/CxxModule.h @@ -20,9 +20,7 @@ class Instance; } // namespace facebook::react -namespace facebook { -namespace xplat { -namespace module { +namespace facebook::xplat::module { /** * Base class for Catalyst native modules whose implementations are @@ -249,6 +247,4 @@ class CxxModule { std::weak_ptr instance_; }; -} // namespace module -} // namespace xplat -} // namespace facebook +} // namespace facebook::xplat::module diff --git a/packages/react-native/ReactCommon/cxxreact/JsArgumentHelpers.h b/packages/react-native/ReactCommon/cxxreact/JsArgumentHelpers.h index cd72e825073..9a907017985 100644 --- a/packages/react-native/ReactCommon/cxxreact/JsArgumentHelpers.h +++ b/packages/react-native/ReactCommon/cxxreact/JsArgumentHelpers.h @@ -20,8 +20,7 @@ // jsArgAs... methods at the end simple to use should be most common, but any // non-detail method can be used when needed. -namespace facebook { -namespace xplat { +namespace facebook::xplat { class JsArgumentException : public std::logic_error { public: @@ -118,7 +117,6 @@ inline std::string jsArgAsString(const folly::dynamic& args, size_t n) { return jsArgN(args, n, &folly::dynamic::asString); } -} // namespace xplat -} // namespace facebook +} // namespace facebook::xplat #include diff --git a/packages/react-native/ReactCommon/cxxreact/ReactMarker.cpp b/packages/react-native/ReactCommon/cxxreact/ReactMarker.cpp index 9180effba85..df845915f88 100644 --- a/packages/react-native/ReactCommon/cxxreact/ReactMarker.cpp +++ b/packages/react-native/ReactCommon/cxxreact/ReactMarker.cpp @@ -8,8 +8,7 @@ #include "ReactMarker.h" #include -namespace facebook::react { -namespace ReactMarker { +namespace facebook::react::ReactMarker { #if __clang__ #pragma clang diagnostic push @@ -138,5 +137,4 @@ double StartupLogger::getAppStartupEndTime() { return appStartupEndTime; } -} // namespace ReactMarker -} // namespace facebook::react +} // namespace facebook::react::ReactMarker diff --git a/packages/react-native/ReactCommon/cxxreact/ReactMarker.h b/packages/react-native/ReactCommon/cxxreact/ReactMarker.h index b74748a655b..c6729dd54bf 100644 --- a/packages/react-native/ReactCommon/cxxreact/ReactMarker.h +++ b/packages/react-native/ReactCommon/cxxreact/ReactMarker.h @@ -14,8 +14,7 @@ #include #endif -namespace facebook::react { -namespace ReactMarker { +namespace facebook::react::ReactMarker { enum ReactMarkerId { APP_STARTUP_START, @@ -106,5 +105,4 @@ extern RN_EXPORT void logMarkerDone( const ReactMarkerId markerId, double markerTime); -} // namespace ReactMarker -} // namespace facebook::react +} // namespace facebook::react::ReactMarker diff --git a/packages/react-native/ReactCommon/cxxreact/SampleCxxModule.cpp b/packages/react-native/ReactCommon/cxxreact/SampleCxxModule.cpp index a739bc84007..b40198c9734 100644 --- a/packages/react-native/ReactCommon/cxxreact/SampleCxxModule.cpp +++ b/packages/react-native/ReactCommon/cxxreact/SampleCxxModule.cpp @@ -15,9 +15,7 @@ using namespace folly; -namespace facebook { -namespace xplat { -namespace samples { +namespace facebook::xplat::samples { std::string Sample::hello() { LOG(WARNING) << "glog: hello, world"; @@ -171,9 +169,7 @@ void SampleCxxModule::load([[maybe_unused]] folly::dynamic args, Callback cb) { cb({d}); } -} // namespace samples -} // namespace xplat -} // namespace facebook +} // namespace facebook::xplat::samples // By convention, the function name should be the same as the class name. facebook::xplat::module::CxxModule* SampleCxxModule() { diff --git a/packages/react-native/ReactCommon/cxxreact/SampleCxxModule.h b/packages/react-native/ReactCommon/cxxreact/SampleCxxModule.h index 155f5842dd7..753bc68466e 100644 --- a/packages/react-native/ReactCommon/cxxreact/SampleCxxModule.h +++ b/packages/react-native/ReactCommon/cxxreact/SampleCxxModule.h @@ -12,9 +12,7 @@ #include -namespace facebook { -namespace xplat { -namespace samples { +namespace facebook::xplat::samples { // In a less contrived example, Sample would be part of a traditional // C++ library. @@ -52,8 +50,6 @@ class SampleCxxModule : public module::CxxModule { std::unique_ptr sample_; }; -} // namespace samples -} // namespace xplat -} // namespace facebook +} // namespace facebook::xplat::samples extern "C" facebook::xplat::module::CxxModule* SampleCxxModule(); diff --git a/packages/react-native/ReactCommon/cxxreact/SharedProxyCxxModule.h b/packages/react-native/ReactCommon/cxxreact/SharedProxyCxxModule.h index 858f9b7f325..c01f3791767 100644 --- a/packages/react-native/ReactCommon/cxxreact/SharedProxyCxxModule.h +++ b/packages/react-native/ReactCommon/cxxreact/SharedProxyCxxModule.h @@ -11,9 +11,7 @@ #include -namespace facebook { -namespace xplat { -namespace module { +namespace facebook::xplat::module { // Allows a Cxx-module to be shared or reused across multiple React instances // Caveat: the setInstance call is not forwarded, so usages of getInstance @@ -39,6 +37,4 @@ class SharedProxyCxxModule : public CxxModule { std::shared_ptr shared_; }; -} // namespace module -} // namespace xplat -} // namespace facebook +} // namespace facebook::xplat::module