From f273f6b2f7a5699a6b651c18dd6853e4a1d6e354 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sun, 28 May 2023 22:20:40 +0200 Subject: [PATCH] Fixed formatting --- .../visitor/translation_unit_visitor.cc | 20 ++++++++++--------- src/common/clang_utils.cc | 4 ++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/class_diagram/visitor/translation_unit_visitor.cc b/src/class_diagram/visitor/translation_unit_visitor.cc index 50bef538..348858c0 100644 --- a/src/class_diagram/visitor/translation_unit_visitor.cc +++ b/src/class_diagram/visitor/translation_unit_visitor.cc @@ -1689,8 +1689,8 @@ void translation_unit_visitor::ensure_lambda_type_is_relative( std::string ¶meter_type) const { #ifdef _MSC_VER - auto root_name = fmt::format( - "{}", std::filesystem::current_path().root_name().string()); + auto root_name = + fmt::format("{}", std::filesystem::current_path().root_name().string()); #else auto root_name = std::string{"/"}; #endif @@ -1706,10 +1706,9 @@ void translation_unit_visitor::ensure_lambda_type_is_relative( #endif auto absolute_lambda_path_end = parameter_type.find(':', lambda_begin + lambda_prefix_size); - auto absolute_lambda_path = - parameter_type.substr(lambda_begin + lambda_prefix_size - 1, - absolute_lambda_path_end - - (lambda_begin + lambda_prefix_size - 1)); + auto absolute_lambda_path = parameter_type.substr( + lambda_begin + lambda_prefix_size - 1, + absolute_lambda_path_end - (lambda_begin + lambda_prefix_size - 1)); auto relative_lambda_path = util::path_to_url( config().make_path_relative(absolute_lambda_path).string()); @@ -2102,7 +2101,8 @@ void translation_unit_visitor::add_class(std::unique_ptr &&c) const auto file = config().make_path_relative(c->file()); - common::model::path p{file.string(), common::model::path_type::kFilesystem}; + common::model::path p{ + file.string(), common::model::path_type::kFilesystem}; p.pop_back(); diagram().add(p, std::move(c)); @@ -2120,7 +2120,8 @@ void translation_unit_visitor::add_enum(std::unique_ptr &&e) const auto file = config().make_path_relative(e->file()); - common::model::path p{file.string(), common::model::path_type::kFilesystem}; + common::model::path p{ + file.string(), common::model::path_type::kFilesystem}; p.pop_back(); diagram().add(p, std::move(e)); @@ -2138,7 +2139,8 @@ void translation_unit_visitor::add_concept(std::unique_ptr &&c) const auto file = config().make_path_relative(c->file()); - common::model::path p{file.string(), common::model::path_type::kFilesystem}; + common::model::path p{ + file.string(), common::model::path_type::kFilesystem}; p.pop_back(); diagram().add(p, std::move(c)); diff --git a/src/common/clang_utils.cc b/src/common/clang_utils.cc index 31d45682..b45eef0a 100644 --- a/src/common/clang_utils.cc +++ b/src/common/clang_utils.cc @@ -748,14 +748,14 @@ bool parse_source_location(const std::string &location_str, std::string &file, try { line = std::stoi(tokens.at(1)); } - catch(std::invalid_argument &e) { + catch (std::invalid_argument &e) { line = 0; } try { column = std::stoi(tokens.at(2)); } - catch(std::invalid_argument &e) { + catch (std::invalid_argument &e) { column = 0; }