Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Checks: >
-cppcoreguidelines-avoid-do-while,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-avoid-non-const-global-variables,
Expand Down
8 changes: 4 additions & 4 deletions api/test/common/kv_properties_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ using opentelemetry::common::KeyValueStringTokenizerOptions;

TEST(KVStringTokenizer, SinglePair)
{
bool valid_kv;
bool valid_kv{};
nostd::string_view key, value;
opentelemetry::nostd::string_view str = "k1=v1";
KeyValueStringTokenizerOptions opts;
Expand All @@ -80,7 +80,7 @@ TEST(KVStringTokenizer, SinglePair)

TEST(KVStringTokenizer, AcceptEmptyEntries)
{
bool valid_kv;
bool valid_kv{};
nostd::string_view key, value;
opentelemetry::nostd::string_view str = ":k1=v1::k2=v2: ";
KeyValueStringTokenizerOptions opts;
Expand All @@ -104,7 +104,7 @@ TEST(KVStringTokenizer, AcceptEmptyEntries)
TEST(KVStringTokenizer, ValidPairsWithEmptyEntries)
{
opentelemetry::nostd::string_view str = "k1:v1===k2:v2==";
bool valid_kv;
bool valid_kv{};
nostd::string_view key, value;
KeyValueStringTokenizerOptions opts;
opts.member_separator = '=';
Expand All @@ -128,7 +128,7 @@ TEST(KVStringTokenizer, InvalidPairs)
{
opentelemetry::nostd::string_view str = "k1=v1,invalid ,, k2=v2 ,invalid";
KeyValueStringTokenizer tk(str);
bool valid_kv;
bool valid_kv{};
nostd::string_view key, value;
EXPECT_TRUE(tk.next(valid_kv, key, value));

Expand Down
2 changes: 1 addition & 1 deletion api/test/nostd/shared_ptr_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ TEST(SharedPtrTest, MoveConstructionFromStdSharedPtr)

TEST(SharedPtrTest, Destruction)
{
bool was_destructed;
bool was_destructed{};
shared_ptr<A>{new A{was_destructed}}; // NOLINT
EXPECT_TRUE(was_destructed);
}
Expand Down
4 changes: 2 additions & 2 deletions api/test/nostd/unique_ptr_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ TEST(UniquePtrTest, MoveConstructionFromStdUniquePtr)

TEST(UniquePtrTest, Destruction)
{
bool was_destructed;
bool was_destructed{};
unique_ptr<A>{new A{was_destructed}}; // NOLINT
EXPECT_TRUE(was_destructed);
}
Expand Down Expand Up @@ -127,7 +127,7 @@ TEST(UniquePtrTest, PointerOperators)

TEST(UniquePtrTest, Reset)
{
bool was_destructed1;
bool was_destructed1{};
unique_ptr<A> ptr{new A{was_destructed1}};
bool was_destructed2 = true;
ptr.reset(new A{was_destructed2});
Expand Down
15 changes: 15 additions & 0 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,21 @@ elif [[ "$1" == "cmake.legacy.test" ]]; then
make -j $(nproc)
make test
exit 0
elif [[ "$1" == "cmake.clang_tidy.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
export BUILD_ROOT="${BUILD_DIR}"
cmake -S ${SRC_DIR} \
-B ${BUILD_DIR} \
-C ${SRC_DIR}/test_common/cmake/all-options-abiv2-preview.cmake \
"${CMAKE_OPTIONS[@]}" \
-DWITH_OPENTRACING=OFF \
-DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_CLANG_TIDY="clang-tidy;--quiet;-p;${BUILD_DIR}"
make -j $(nproc)
make test
exit 0
elif [[ "$1" == "cmake.legacy.exporter.otprotocol.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
Expand Down
7 changes: 2 additions & 5 deletions examples/grpc/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,12 @@ int main(int argc, char **argv)
opentelemetry::nostd::shared_ptr<context::propagation::TextMapPropagator>(
new propagation::HttpTraceContext()));
constexpr uint16_t default_port = 8800;
uint16_t port;
uint16_t port{default_port};
if (argc > 1)
{
port = static_cast<uint16_t>(atoi(argv[1]));
}
else
{
port = default_port;
}

RunClient(port);
CleanupTracer();
return 0;
Expand Down
6 changes: 1 addition & 5 deletions examples/grpc/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,11 @@ int main(int argc, char **argv)
{
InitTracer();
constexpr uint16_t default_port = 8800;
uint16_t port;
uint16_t port{default_port};
if (argc > 1)
{
port = static_cast<uint16_t>(atoi(argv[1]));
}
else
{
port = default_port;
}

RunServer(port);
CleanupTracer();
Expand Down
6 changes: 1 addition & 5 deletions examples/http/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,13 @@ int main(int argc, char *argv[])
constexpr char default_host[] = "localhost";
constexpr char default_path[] = "/helloworld";
constexpr uint16_t default_port = 8800;
uint16_t port;
uint16_t port{default_port};

// The port the validation service listens to can be specified via the command line.
if (argc > 1)
{
port = static_cast<uint16_t>(atoi(argv[1]));
}
else
{
port = default_port;
}

std::string url = "http://" + std::string(default_host) + ":" + std::to_string(port) +
std::string(default_path);
Expand Down
3 changes: 2 additions & 1 deletion exporters/ostream/src/console_push_metric_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ void ConsolePushMetricBuilder::Register(opentelemetry::sdk::configuration::Regis
std::unique_ptr<opentelemetry::sdk::metrics::PushMetricExporter> ConsolePushMetricBuilder::Build(
const opentelemetry::sdk::configuration::ConsolePushMetricExporterConfiguration *model) const
{
sdk::metrics::AggregationTemporality aggregation_temporality;
sdk::metrics::AggregationTemporality aggregation_temporality{
sdk::metrics::AggregationTemporality::kUnspecified};

switch (model->temporality_preference)
{
Expand Down
Loading