Skip to content

Commit

Permalink
Apply clang-tidy modernize-concat-nested-namespaces
Browse files Browse the repository at this point in the history
Summary: Apply [modernize-concat-nested-namespaces](https://clang.llvm.org/extra/clang-tidy/checks/modernize/concat-nested-namespaces.html)(C++17) check to `thrift/lib/cpp2`.

Reviewed By: rmakheja

Differential Revision: D64049325

fbshipit-source-id: 042570700b75602634a2c71e834a55c0e9847860
  • Loading branch information
yoney authored and facebook-github-bot committed Oct 8, 2024
1 parent 3ced53b commit 384953c
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 78 deletions.
6 changes: 2 additions & 4 deletions third-party/thrift/src/thrift/lib/cpp2/BadFieldAccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@

#include <stdexcept>

namespace apache {
namespace thrift {
namespace apache::thrift {

// Base exception type for field access errors
class bad_field_access : public std::runtime_error {
Expand All @@ -43,5 +42,4 @@ class bad_union_field_access : public bad_field_access {
: bad_field_access("accessing unset or mismatched type union value") {}
};

} // namespace thrift
} // namespace apache
} // namespace apache::thrift
6 changes: 2 additions & 4 deletions third-party/thrift/src/thrift/lib/cpp2/TypeClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

#pragma once

namespace apache {
namespace thrift {
namespace apache::thrift {

/**
* The type class of a type as declared in a .thrift file.
Expand Down Expand Up @@ -101,5 +100,4 @@ namespace detail {
template <typename TypeClass, typename Indirection>
struct indirection_tag;
} // namespace detail
} // namespace thrift
} // namespace apache
} // namespace apache::thrift
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@

#include <string>

namespace facebook {
namespace thrift {
namespace detail {
namespace facebook::thrift::detail {

template <typename Tag, typename T, typename Callback>
bool debug_thrift_data_difference(std::string&, T const&, T const&, Callback&&);

} // namespace detail
} // namespace thrift
} // namespace facebook
} // namespace facebook::thrift::detail
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@

#pragma once

namespace facebook {
namespace thrift {
namespace detail {
namespace facebook::thrift::detail {

template <typename>
struct pretty_print_impl;

} // namespace detail
} // namespace thrift
} // namespace facebook
} // namespace facebook::thrift::detail
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@

#pragma once

namespace facebook {
namespace thrift {
namespace detail {
namespace facebook::thrift::detail {

template <typename, typename = void>
struct dynamic_converter_impl;

} // namespace detail
} // namespace thrift
} // namespace facebook
} // namespace facebook::thrift::detail
6 changes: 2 additions & 4 deletions third-party/thrift/src/thrift/lib/cpp2/frozen/Traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
#pragma once
#include <type_traits>

namespace apache {
namespace thrift {
namespace apache::thrift {

template <class>
struct IsString : std::false_type {};
Expand All @@ -40,8 +39,7 @@ template <class>
struct IsExcluded : std::false_type {};
} // namespace frozen

} // namespace thrift
} // namespace apache
} // namespace apache::thrift

#define THRIFT_DECLARE_TRAIT(Trait, ...) \
namespace apache { \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@

#include <cstdint>

namespace apache {
namespace thrift {
namespace detail {
namespace apache::thrift::detail {
enum class ReservedId : int16_t {
kOffset = -32768, // Lazy deserialization
kIndex = -32767, // Lazy deserialization
Expand All @@ -30,6 +28,4 @@ enum class ReservedId : int16_t {
kInjectMetadataFieldsLastId = -2000, // @internal.InjectMetadataFields
kInjectMetadataFieldsStartId = -1000, // @internal.InjectMetadataFields
};
} // namespace detail
} // namespace thrift
} // namespace apache
} // namespace apache::thrift::detail
6 changes: 2 additions & 4 deletions third-party/thrift/src/thrift/lib/cpp2/reflection/indenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
#include <utility>
#include <vector>

namespace apache {
namespace thrift {
namespace apache::thrift {

/**
* Wraps a stream and provides facilities for automatically indenting output.
Expand Down Expand Up @@ -154,7 +153,6 @@ indenter<std::remove_reference_t<OutputStream>> make_indenter(
return {out, std::forward<Indentation>(indentation), std::move(margin)};
}

} // namespace thrift
} // namespace apache
} // namespace apache::thrift

#endif // THRIFT_FATAL_INDENTER_H_
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,3 @@
*/

#pragma once

namespace apache {
namespace thrift {

namespace legacy_reflection_detail {}

} // namespace thrift
} // namespace apache
6 changes: 2 additions & 4 deletions third-party/thrift/src/thrift/lib/cpp2/test/util/FakeClock.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@

#include <chrono>

namespace apache {
namespace thrift {
namespace apache::thrift {

class FakeClock {
public:
Expand All @@ -42,5 +41,4 @@ class FakeClock {
static time_point now_us_;
};

} // namespace thrift
} // namespace apache
} // namespace apache::thrift
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@

#include <cstdint>

namespace apache {
namespace thrift {
namespace rocket {
namespace apache::thrift::rocket {

// Commented-out values are not currently used/needed in Thrift, but may be
// in the future.
Expand Down Expand Up @@ -51,6 +49,4 @@ enum class ExtFrameType : uint32_t {
// CUSTOM_ALLOC = 0xFB3,
};

} // namespace rocket
} // namespace thrift
} // namespace apache
} // namespace apache::thrift::rocket
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
#pragma once
#include <cstdint>

namespace apache {
namespace thrift {
namespace apache::thrift {

class Cpp2ConnContext;

Expand Down Expand Up @@ -72,5 +71,4 @@ class RocketServerHandler {
};

} // namespace rocket
} // namespace thrift
} // namespace apache
} // namespace apache::thrift
8 changes: 2 additions & 6 deletions third-party/thrift/src/thrift/lib/cpp2/type/Tag.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@

#include <cstdint>

namespace apache {
namespace thrift {
namespace type {
namespace apache::thrift::type {

enum class FieldId : ::std::int16_t;

Expand Down Expand Up @@ -111,6 +109,4 @@ struct fields;
template <typename Tag, typename Context>
struct field : Tag {};

} // namespace type
} // namespace thrift
} // namespace apache
} // namespace apache::thrift::type
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@

#include <cstdint>

namespace apache {
namespace thrift {
namespace type {
namespace apache::thrift::type {
enum class UniversalHashAlgorithm {
Sha2_256 = 2,
};

constexpr const int8_t kMinHashBytes = 8;
constexpr const int8_t kDefaultHashBytes = 16;
} // namespace type
} // namespace thrift
} // namespace apache
} // namespace apache::thrift::type
6 changes: 2 additions & 4 deletions third-party/thrift/src/thrift/lib/cpp2/util/Ewma.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
#include <chrono>
#include <cmath>

namespace apache {
namespace thrift {
namespace apache::thrift {

/**
* Compute the EWMA (Exponential Weighted Moving Average) of a
Expand Down Expand Up @@ -77,5 +76,4 @@ class Ewma {
std::chrono::time_point<Clock> timestamp_;
};

} // namespace thrift
} // namespace apache
} // namespace apache::thrift

0 comments on commit 384953c

Please sign in to comment.