style: clang-tidy auto fixes (#2420)

This commit is contained in:
github-actions[bot]
2025-08-11 19:59:47 +01:00
committed by GitHub
parent 9420c506ca
commit 333b73e882
4 changed files with 4 additions and 7 deletions

View File

@@ -38,7 +38,7 @@ int
main(int argc, char const* argv[]) main(int argc, char const* argv[])
try { try {
util::setTerminationHandler(); util::setTerminationHandler();
util::ScopeGuard loggerShutdownGuard{[]() { util::LogService::shutdown(); }}; util::ScopeGuard const loggerShutdownGuard{[]() { util::LogService::shutdown(); }};
auto const action = app::CliArgs::parse(argc, argv); auto const action = app::CliArgs::parse(argc, argv);
return action.apply( return action.apply(

View File

@@ -32,7 +32,6 @@
#include <spdlog/async_logger.h> #include <spdlog/async_logger.h>
#include <spdlog/common.h> #include <spdlog/common.h>
#include <spdlog/logger.h> #include <spdlog/logger.h>
#include <spdlog/sinks/basic_file_sink.h>
#include <spdlog/sinks/rotating_file_sink.h> #include <spdlog/sinks/rotating_file_sink.h>
#include <spdlog/sinks/stdout_color_sinks.h> #include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h> #include <spdlog/spdlog.h>
@@ -344,7 +343,7 @@ Logger::Pump::Pump(std::shared_ptr<spdlog::logger> logger, Severity sev, SourceL
Logger::Pump::~Pump() Logger::Pump::~Pump()
{ {
if (enabled_) { if (enabled_) {
spdlog::source_loc sourceLocation{prettyPath(sourceLocation_).cbegin(), sourceLocation_.line(), nullptr}; spdlog::source_loc const sourceLocation{prettyPath(sourceLocation_).cbegin(), sourceLocation_.line(), nullptr};
logger_->log(sourceLocation, toSpdlogLevel(severity_), std::move(stream_).str()); logger_->log(sourceLocation, toSpdlogLevel(severity_), std::move(stream_).str());
} }
} }
@@ -387,7 +386,7 @@ Logger::Logger(std::shared_ptr<spdlog::logger> logger) : logger_(std::move(logge
std::string_view std::string_view
Logger::Pump::prettyPath(SourceLocationType const& loc, size_t maxDepth) Logger::Pump::prettyPath(SourceLocationType const& loc, size_t maxDepth)
{ {
std::string_view filePath{loc.file_name()}; std::string_view const filePath{loc.file_name()};
auto idx = filePath.size(); auto idx = filePath.size();
while (maxDepth-- > 0) { while (maxDepth-- > 0) {
idx = filePath.rfind('/', idx - 1); idx = filePath.rfind('/', idx - 1);

View File

@@ -20,8 +20,6 @@
#include "util/LoggerFixtures.hpp" #include "util/LoggerFixtures.hpp"
#include "util/log/Logger.hpp" #include "util/log/Logger.hpp"
#include <fmt/format.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <cstddef> #include <cstddef>

View File

@@ -27,6 +27,6 @@ TEST(ScopeGuardTest, IsCalled)
testing::StrictMock<testing::MockFunction<void()>> mockFunction; testing::StrictMock<testing::MockFunction<void()>> mockFunction;
EXPECT_CALL(mockFunction, Call()); EXPECT_CALL(mockFunction, Call());
{ {
util::ScopeGuard guard([&mockFunction] { mockFunction.Call(); }); util::ScopeGuard const guard([&mockFunction] { mockFunction.Call(); });
} }
} }