From 316fda17759a5b26d1ce3ff6237e8eb91f0cf331 Mon Sep 17 00:00:00 2001 From: Aaron Po Date: Fri, 1 May 2026 17:40:37 -0400 Subject: [PATCH] codebase formatting --- .../includes/services/sqlite_connection_helpers.h | 5 ++--- .../services/sqlite_export_service_helpers.h | 2 +- .../pipeline/includes/services/sqlite_handle_types.h | 2 +- .../includes/services/sqlite_statement_helpers.h | 5 +++-- .../src/data_generation/llama/generate_brewery.cc | 3 ++- tooling/pipeline/src/services/sqlite/finalize.cc | 1 - .../sqlite/helpers/sqlite_connection_helpers.cpp | 8 ++++---- .../sqlite/helpers/sqlite_statement_helpers.cpp | 12 ++++++------ tooling/pipeline/src/services/sqlite/initialize.cc | 2 -- 9 files changed, 19 insertions(+), 21 deletions(-) diff --git a/tooling/pipeline/includes/services/sqlite_connection_helpers.h b/tooling/pipeline/includes/services/sqlite_connection_helpers.h index 7509c0e..b8dd370 100644 --- a/tooling/pipeline/includes/services/sqlite_connection_helpers.h +++ b/tooling/pipeline/includes/services/sqlite_connection_helpers.h @@ -7,6 +7,7 @@ */ #include + #include #include #include @@ -20,12 +21,10 @@ void ThrowSqliteError(sqlite3* db_handle, std::string_view action); SqliteDatabaseHandle OpenDatabase(const std::filesystem::path& path); void ExecSql(const SqliteDatabaseHandle& db_handle, std::string_view sql, - const char* action); + const char* action); void RollbackTransactionNoThrow(const SqliteDatabaseHandle& db_handle) noexcept; } // namespace sqlite_export_service_internal #endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_CONNECTION_HELPERS_H_ - - diff --git a/tooling/pipeline/includes/services/sqlite_export_service_helpers.h b/tooling/pipeline/includes/services/sqlite_export_service_helpers.h index 9b63aa5..e18766a 100644 --- a/tooling/pipeline/includes/services/sqlite_export_service_helpers.h +++ b/tooling/pipeline/includes/services/sqlite_export_service_helpers.h @@ -3,8 +3,8 @@ /* Umbrella header for backward compatibility. */ -#include "services/sqlite_handle_types.h" #include "services/sqlite_connection_helpers.h" +#include "services/sqlite_handle_types.h" #include "services/sqlite_statement_helpers.h" #endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_EXPORT_SERVICE_HELPERS_H_ diff --git a/tooling/pipeline/includes/services/sqlite_handle_types.h b/tooling/pipeline/includes/services/sqlite_handle_types.h index 6994c4a..92da0ef 100644 --- a/tooling/pipeline/includes/services/sqlite_handle_types.h +++ b/tooling/pipeline/includes/services/sqlite_handle_types.h @@ -6,6 +6,7 @@ */ #include + #include #include @@ -33,4 +34,3 @@ struct BindParam { } // namespace sqlite_export_service_internal #endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_HANDLE_TYPES_H_ - diff --git a/tooling/pipeline/includes/services/sqlite_statement_helpers.h b/tooling/pipeline/includes/services/sqlite_statement_helpers.h index 74f54b1..35cf829 100644 --- a/tooling/pipeline/includes/services/sqlite_statement_helpers.h +++ b/tooling/pipeline/includes/services/sqlite_statement_helpers.h @@ -3,10 +3,12 @@ /** * @file services/sqlite_statement_helpers.h - * @brief Declarations for statement-level SQLite helper functions and constants. + * @brief Declarations for statement-level SQLite helper functions and + * constants. */ #include + #include #include #include @@ -112,4 +114,3 @@ std::string SerializeVector(const std::vector& str_vec); } // namespace sqlite_export_service_internal #endif // BIERGARTEN_PIPELINE_INCLUDES_SERVICES_SQLITE_STATEMENT_HELPERS_H_ - diff --git a/tooling/pipeline/src/data_generation/llama/generate_brewery.cc b/tooling/pipeline/src/data_generation/llama/generate_brewery.cc index 011a64f..569036b 100644 --- a/tooling/pipeline/src/data_generation/llama/generate_brewery.cc +++ b/tooling/pipeline/src/data_generation/llama/generate_brewery.cc @@ -34,7 +34,8 @@ static std::string FormatLocalLanguageCodes( } // GBNF grammar for structured brewery JSON output. -// @TODO move to a separate gbnf file if it grows in complexity or is shared across modules. +// @TODO move to a separate gbnf file if it grows in complexity or is shared +// across modules. static constexpr std::string_view kBreweryJsonGrammar = R"json_brewery( root ::= thought-block "{" ws "\"name_en\"" ws ":" ws string ws "," ws "\"description_en\"" ws ":" ws string ws "," ws "\"name_local\"" ws ":" ws string ws "," ws "\"description_local\"" ws ":" ws string ws "}" ws thought-block ::= [^{]* diff --git a/tooling/pipeline/src/services/sqlite/finalize.cc b/tooling/pipeline/src/services/sqlite/finalize.cc index ffb9d54..b2ef035 100644 --- a/tooling/pipeline/src/services/sqlite/finalize.cc +++ b/tooling/pipeline/src/services/sqlite/finalize.cc @@ -8,7 +8,6 @@ #include "services/sqlite_export_service.h" #include "services/sqlite_export_service_helpers.h" - void SqliteExportService::Finalize() { if (db_handle_ == nullptr) { return; diff --git a/tooling/pipeline/src/services/sqlite/helpers/sqlite_connection_helpers.cpp b/tooling/pipeline/src/services/sqlite/helpers/sqlite_connection_helpers.cpp index 1c302e6..b5fec26 100644 --- a/tooling/pipeline/src/services/sqlite/helpers/sqlite_connection_helpers.cpp +++ b/tooling/pipeline/src/services/sqlite/helpers/sqlite_connection_helpers.cpp @@ -10,7 +10,8 @@ void SqliteDatabaseDeleter::operator()(sqlite3* handle) const noexcept { } } -void SqliteStatementDeleter::operator()(sqlite3_stmt* statement) const noexcept { +void SqliteStatementDeleter::operator()( + sqlite3_stmt* statement) const noexcept { if (statement != nullptr) { sqlite3_finalize(statement); } @@ -23,7 +24,6 @@ void ThrowSqliteError(sqlite3* db_handle, std::string_view action) { } SqliteDatabaseHandle OpenDatabase(const std::filesystem::path& path) { - sqlite3* raw_handle = nullptr; const int result = sqlite3_open(path.string().c_str(), &raw_handle); @@ -54,7 +54,8 @@ void ExecSql(const SqliteDatabaseHandle& db_handle, std::string_view sql, } } -void RollbackTransactionNoThrow(const SqliteDatabaseHandle& db_handle) noexcept { +void RollbackTransactionNoThrow( + const SqliteDatabaseHandle& db_handle) noexcept { if (!db_handle) { return; } @@ -63,4 +64,3 @@ void RollbackTransactionNoThrow(const SqliteDatabaseHandle& db_handle) noexcept } } // namespace sqlite_export_service_internal - diff --git a/tooling/pipeline/src/services/sqlite/helpers/sqlite_statement_helpers.cpp b/tooling/pipeline/src/services/sqlite/helpers/sqlite_statement_helpers.cpp index 12620f8..9da278f 100644 --- a/tooling/pipeline/src/services/sqlite/helpers/sqlite_statement_helpers.cpp +++ b/tooling/pipeline/src/services/sqlite/helpers/sqlite_statement_helpers.cpp @@ -1,11 +1,12 @@ #include "services/sqlite_statement_helpers.h" -#include "services/sqlite_connection_helpers.h" -#include -#include -#include -#include #include +#include +#include +#include +#include + +#include "services/sqlite_connection_helpers.h" namespace sqlite_export_service_internal { @@ -95,4 +96,3 @@ std::string SerializeVector(const std::vector& str_vec) { } } // namespace sqlite_export_service_internal - diff --git a/tooling/pipeline/src/services/sqlite/initialize.cc b/tooling/pipeline/src/services/sqlite/initialize.cc index f3f7560..e86b21d 100644 --- a/tooling/pipeline/src/services/sqlite/initialize.cc +++ b/tooling/pipeline/src/services/sqlite/initialize.cc @@ -11,7 +11,6 @@ #include "services/sqlite_export_service.h" #include "services/sqlite_export_service_helpers.h" - void SqliteExportService::InitializeSchema() const { sqlite_export_service_internal::ExecSql( db_handle_, sqlite_export_service_internal::kCreateLocationsTableSql, @@ -46,7 +45,6 @@ void SqliteExportService::RollbackAndCloseNoThrow() noexcept { location_cache_.clear(); } - void SqliteExportService::Initialize() { if (db_handle_ != nullptr) { throw std::runtime_error("SQLite export service is already initialized");