diff --git a/.clang-tidy b/.clang-tidy index 890d0a8e..d9f5817e 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -18,6 +18,7 @@ Checks: > bugprone-unused-raii, bugprone-virtual-near-miss, misc-unused-using-decls, + readability-braces-around-statements, readability-delete-null-pointer, readability-redundant-control-flow, readability-redundant-string-cstr @@ -33,5 +34,8 @@ Checks: > # performance-noexcept-move-constructor # readability-redundant-member-init # readability-simplify-boolean-expr +CheckOptions: + - key: readability-braces-around-statements.ShortStatementLines + value: 1 WarningsAsErrors: '*' FormatStyle: file diff --git a/mod_datadog/src/tracing/hooks.cpp b/mod_datadog/src/tracing/hooks.cpp index b6df5f07..c7f539e1 100644 --- a/mod_datadog/src/tracing/hooks.cpp +++ b/mod_datadog/src/tracing/hooks.cpp @@ -50,8 +50,9 @@ static SpanConfig make_span_config( if (r->hostname != nullptr) tags.emplace("http.host", r->hostname); if (r->unparsed_uri != nullptr) tags.emplace("http.url", r->unparsed_uri); - if (r->useragent_ip != nullptr) + if (r->useragent_ip != nullptr) { tags.emplace("http.client_ip", r->useragent_ip); + } if (auto mpm_name = ap_show_mpm(); mpm_name != nullptr) { tags.emplace("httpd.mpm", mpm_name); @@ -123,9 +124,10 @@ int on_fixups(request_rec* r, Tracer& g_tracer, module* datadog_module) { } void* data = ap_get_module_config(r->request_config, datadog_module); - if (data) + if (data) { return DECLINED; ///< `start_span` can not be called twice on the same ///< request + } SpanConfig options = make_span_config(r, dir_conf->tags);