diff --git a/pipeline/.clang-tidy b/pipeline/.clang-tidy index 836f842..c180f75 100644 --- a/pipeline/.clang-tidy +++ b/pipeline/.clang-tidy @@ -9,21 +9,23 @@ Checks: > -google-runtime-references CheckOptions: - # Enforce Google Naming Conventions + # Enforce Google Naming Conventions with valid clang-tidy strings + - key: readability-identifier-naming.ClassCase + value: CamelCase - key: readability-identifier-naming.ClassMemberCase - value: snake_case + value: lower_case - key: readability-identifier-naming.ClassMemberSuffix value: _ - - key: readability-identifier-naming.ClassCase - value: PascalCase - key: readability-identifier-naming.FunctionCase - value: PascalCase + value: CamelCase - key: readability-identifier-naming.StructCase - value: PascalCase + value: CamelCase - key: readability-identifier-naming.VariableCase - value: snake_case + value: lower_case - key: readability-identifier-naming.GlobalConstantCase - value: kPascalCase + value: CamelCase + - key: readability-identifier-naming.GlobalConstantPrefix + value: k # Ensure C++20 Modernization - key: modernize-make-unique.MakeSmartPtrFunction diff --git a/pipeline/includes/data_generation/llama_generator.h b/pipeline/includes/data_generation/llama_generator.h index 5c7271d..be9d2f0 100644 --- a/pipeline/includes/data_generation/llama_generator.h +++ b/pipeline/includes/data_generation/llama_generator.h @@ -16,7 +16,7 @@ struct llama_model; struct llama_context; -struct llama_sampler; +struct LlamaSampler; /** * @brief Data generator implementation backed by llama.cpp. @@ -74,7 +74,7 @@ class LlamaGenerator final : public DataGenerator { SamplerState(SamplerState&&) = delete; SamplerState& operator=(SamplerState&&) = delete; - llama_sampler* chain = nullptr; + LlamaSampler* chain = nullptr; }; /** diff --git a/pipeline/includes/data_generation/mock_generator.h b/pipeline/includes/data_generation/mock_generator.h index cad9433..8322998 100644 --- a/pipeline/includes/data_generation/mock_generator.h +++ b/pipeline/includes/data_generation/mock_generator.h @@ -44,18 +44,18 @@ class MockGenerator final : public DataGenerator { */ static std::size_t DeterministicHash(const Location& location); - inline static constexpr std::array kBreweryAdjectives = + static constexpr std::array kBreweryAdjectives = {"Craft", "Heritage", "Local", "Artisan", "Pioneer", "Golden", "Modern", "Classic", "Summit", "Northern", "Riverstone", "Barrel", "Hinterland", "Harbor", "Wild", "Granite", "Copper", "Maple"}; - inline static constexpr std::array kBreweryNouns = { + static constexpr std::array kBreweryNouns = { "Brewing Co.", "Brewery", "Bier Haus", "Taproom", "Works", "House", "Fermentery", "Ale Co.", "Cellars", "Collective", "Project", "Foundry", "Malthouse", "Public House", "Co-op", "Lab", "Beer Hall", "Guild"}; - inline static constexpr std::array + static constexpr std::array kBreweryDescriptions = { "Handcrafted pale ales and seasonal IPAs with local ingredients.", "Traditional lagers and experimental sours in small batches.", @@ -90,14 +90,14 @@ class MockGenerator final : public DataGenerator { "Destination taproom known for balanced IPAs and cocoa-rich " "stouts."}; - inline static constexpr std::array kUsernames = { + static constexpr std::array kUsernames = { "hopseeker", "malttrail", "yeastwhisper", "lagerlane", "barrelbound", "foamfinder", "taphunter", "graingeist", "brewscout", "aleatlas", "caskcompass", "hopsandmaps", "mashpilot", "pintnomad", "fermentfriend", "stoutsignal", "sessionwander", "kettlekeeper"}; - inline static constexpr std::array kBios = { + static constexpr std::array kBios = { "Always chasing balanced IPAs and crisp lagers across local taprooms.", "Weekend brewery explorer with a soft spot for dark, roasty stouts.", "Documenting tiny brewpubs, fresh pours, and unforgettable beer " diff --git a/pipeline/includes/data_model/brewery_result.h b/pipeline/includes/data_model/brewery_result.h index d40c009..09ce680 100644 --- a/pipeline/includes/data_model/brewery_result.h +++ b/pipeline/includes/data_model/brewery_result.h @@ -13,10 +13,10 @@ */ struct BreweryResult { /// @brief Brewery display name. - std::string name; + std::string name{}; /// @brief Brewery description text. - std::string description; + std::string description{}; }; #endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_BREWERY_RESULT_H_ diff --git a/pipeline/includes/data_model/enriched_city.h b/pipeline/includes/data_model/enriched_city.h index 613fba4..babe452 100644 --- a/pipeline/includes/data_model/enriched_city.h +++ b/pipeline/includes/data_model/enriched_city.h @@ -15,7 +15,7 @@ */ struct EnrichedCity { Location location; - std::string region_context; + std::string region_context{}; }; #endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_ENRICHED_CITY_H_ diff --git a/pipeline/includes/data_model/location.h b/pipeline/includes/data_model/location.h index 74d62b2..565a5be 100644 --- a/pipeline/includes/data_model/location.h +++ b/pipeline/includes/data_model/location.h @@ -13,25 +13,25 @@ */ struct Location { /// @brief City name. - std::string city; + std::string city{}; /// @brief State or province name. - std::string state_province; + std::string state_province{}; /// @brief ISO 3166-2 subdivision code. - std::string iso3166_2; + std::string iso3166_2{}; /// @brief Country name. - std::string country; + std::string country{}; /// @brief ISO 3166-1 country code. - std::string iso3166_1; + std::string iso3166_1{}; /// @brief Latitude in decimal degrees. - double latitude; + double latitude{}; /// @brief Longitude in decimal degrees. - double longitude; + double longitude{}; }; #endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_LOCATION_H_ diff --git a/pipeline/includes/data_model/user_result.h b/pipeline/includes/data_model/user_result.h index fa018c8..683515e 100644 --- a/pipeline/includes/data_model/user_result.h +++ b/pipeline/includes/data_model/user_result.h @@ -13,10 +13,10 @@ */ struct UserResult { /// @brief Username handle. - std::string username; + std::string username{}; /// @brief Short user biography. - std::string bio; + std::string bio{}; }; #endif // BIERGARTEN_PIPELINE_INCLUDES_DATA_MODEL_USER_RESULT_H_ diff --git a/pipeline/src/main.cpp b/pipeline/src/main.cpp index c8ac0ce..7f7134a 100644 --- a/pipeline/src/main.cpp +++ b/pipeline/src/main.cpp @@ -103,7 +103,7 @@ std::optional ParseArguments(const int argc, const bool has_llm_params = !variables_map["temperature"].defaulted() || !variables_map["top-p"].defaulted() || !variables_map["top-k"].defaulted() || - !variables_map["seed"].defaulted(); + !variables_map["seed"].defaulted() = false; if (use_mocked && has_llm_params) { spdlog::warn(