Skip to content

Commit 9592939

Browse files
committed
[yugabyte#25536] docdb: Remove NOLINT from requires
Summary: Defining a concept as below used to lead to readability/braces errors: ``` template<typename T> concept TestConcept = requires(T value) { // ... }; ``` We used to `// NOLINT` wherever this applied. This lint error has been fixed, so removing the `// NOLINT` comments. Jira: DB-14791 Test Plan: Jenkins: compile only Reviewers: hsunder Reviewed By: hsunder Subscribers: yql, ybase Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D41090
1 parent 66fd3f9 commit 9592939

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

src/yb/docdb/pgsql_operation.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,12 +621,12 @@ template <typename T>
621621
concept Prefetcher = requires(
622622
T& key_provider, FilteringIterator& iterator, const dockv::ReaderProjection& projection) {
623623
{ key_provider.Prefetch(iterator, projection) } -> std::same_as<Status>;
624-
}; // NOLINT
624+
};
625625

626626
template <typename T>
627627
concept BoundsProvider = requires(T& key_provider) {
628628
{ key_provider.Bounds() } -> std::same_as<YbctidBounds>;
629-
}; // NOLINT
629+
};
630630

631631
template <typename T>
632632
YbctidBounds Bounds(const T& key_provider) {

src/yb/rpc/thread_pool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class ThreadPoolTask {
5656
template <typename T>
5757
concept ThreadPoolTaskOrSubclass = requires (T* t) {
5858
std::is_base_of_v<ThreadPoolTask, T>;
59-
}; // NOLINT
59+
};
6060

6161
template <class F, ThreadPoolTaskOrSubclass Base>
6262
class FunctorThreadPoolTask : public Base {

src/yb/tserver/pg_client_session.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ class PgClientSession {
360360
template <class Pb>
361361
concept PbWith_AshMetadataPB = requires (const Pb& t) {
362362
t.ash_metadata();
363-
}; // NOLINT
363+
};
364364

365365
template <PbWith_AshMetadataPB Pb>
366366
void TryUpdateAshWaitState(const Pb& req) {

src/yb/util/pb_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ namespace yb {
101101

102102
namespace pb_util_internal {
103103
template <class T>
104-
concept TypeWithEmpty = requires(const T& t) { empty(t); }; // NOLINT
104+
concept TypeWithEmpty = requires(const T& t) { empty(t); };
105105

106106
template <class T>
107107
concept TypeWithoutEmpty = !TypeWithEmpty<T>; // NOLINT

src/yb/util/thread_holder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class ThreadHolder {
115115
template<typename Functor, typename IntegralCounter>
116116
concept StatusFunctorTypeAcceptingIntegral = requires(Functor f, IntegralCounter i) {
117117
{ f(i) } -> std::same_as<Status>;
118-
}; // NOLINT
118+
};
119119

120120
// Processes a collection of items in multiple threads. The nature of items does not matter. The
121121
// processing function only receives an index index of an item. If processing of any item fails, all

src/yb/util/tostring.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ namespace yb_tostring {
4848
template <class T>
4949
concept TypeSupportsOutputToStream = requires (const T& t) {
5050
(*static_cast<std::ostream*>(nullptr)) << t;
51-
}; // NOLINT
51+
};
5252

5353
template <class T>
5454
concept TypeWithFree_to_string = requires (const T& t) {
5555
to_string(t);
56-
}; // NOLINT
56+
};
5757

5858
} // namespace yb_tostring
5959

@@ -63,12 +63,12 @@ namespace yb {
6363
template <class T>
6464
concept TypeWith_ToString = requires (const T& t) {
6565
t.ToString();
66-
}; // NOLINT
66+
};
6767

6868
template <class T>
6969
concept TypeWith_to_string = requires (const T& t) {
7070
t.to_string();
71-
}; // NOLINT
71+
};
7272

7373
template <TypeWith_ToString T>
7474
decltype(auto) ToString(const T& value) {
@@ -84,7 +84,7 @@ decltype(auto) ToString(const T& value) {
8484
template <class T>
8585
concept TypeWith_ShortDebugString = requires (const T& t) {
8686
t.ShortDebugString();
87-
}; // NOLINT
87+
};
8888

8989
template <TypeWith_ShortDebugString T>
9090
decltype(auto) ToString(const T& value) {

src/yb/util/type_traits.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ concept TupleLikeType =
109109
typename std::tuple_size<T>::type;
110110
typename std::tuple_element_t<0, T>;
111111
std::get<0>(a);
112-
}; // NOLINT
112+
};
113113

114114
template<typename T>
115115
concept NonReferenceType = !std::is_reference_v<T>;

0 commit comments

Comments
 (0)