From 7153666087a2c145c06dd637d69c44375243b343 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Fri, 13 Jan 2023 18:24:26 +0100 Subject: [PATCH] Fixed formatting --- src/common/generators/plantuml/generator.h | 1 - src/include_diagram/model/diagram.cc | 3 ++- src/include_diagram/model/diagram.h | 3 ++- src/util/util.cc | 10 +++++----- src/util/util.h | 2 +- tests/test_model.cc | 1 - 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common/generators/plantuml/generator.h b/src/common/generators/plantuml/generator.h index 70067bb9..9b62a281 100644 --- a/src/common/generators/plantuml/generator.h +++ b/src/common/generators/plantuml/generator.h @@ -569,7 +569,6 @@ template void generator::init_env() auto element_opt = m_model.get_with_namespace( args[0]->get(), m_config.using_namespace()); - if (!element_opt.has_value()) throw clanguml::error::uml_alias_missing( args[0]->get()); diff --git a/src/include_diagram/model/diagram.cc b/src/include_diagram/model/diagram.cc index dfd73bae..40b5e38a 100644 --- a/src/include_diagram/model/diagram.cc +++ b/src/include_diagram/model/diagram.cc @@ -140,7 +140,8 @@ diagram::files() const } common::optional_ref -diagram::get_with_namespace(const std::string &name, const common::model::namespace_ &ns) const +diagram::get_with_namespace( + const std::string &name, const common::model::namespace_ &ns) const { // Convert to preferred OS path std::filesystem::path namePath{name}; diff --git a/src/include_diagram/model/diagram.h b/src/include_diagram/model/diagram.h index 97692d7c..6aea9cc9 100644 --- a/src/include_diagram/model/diagram.h +++ b/src/include_diagram/model/diagram.h @@ -60,7 +60,8 @@ public: const common::reference_vector &files() const; common::optional_ref - get_with_namespace(const std::string &name, const common::model::namespace_ &ns) const override; + get_with_namespace(const std::string &name, + const common::model::namespace_ &ns) const override; inja::json context() const override; diff --git a/src/util/util.cc b/src/util/util.cc index f683c0b5..6dde5fdc 100644 --- a/src/util/util.cc +++ b/src/util/util.cc @@ -303,20 +303,20 @@ std::size_t hash_seed(std::size_t seed) return kSeedStart + (seed << kSeedShiftFirst) + (seed >> kSeedShiftSecond); } -std::string path_to_url(const std::filesystem::path& p) { +std::string path_to_url(const std::filesystem::path &p) +{ std::vector path_tokens; auto it = p.begin(); - if(p.has_root_directory()) + if (p.has_root_directory()) it++; - for(; it != p.end(); it++) + for (; it != p.end(); it++) path_tokens.push_back(it->string()); - if(p.has_root_directory()) + if (p.has_root_directory()) return fmt::format("/{}", fmt::join(path_tokens, "/")); else return fmt::format("{}", fmt::join(path_tokens, "/")); - } } // namespace clanguml::util diff --git a/src/util/util.h b/src/util/util.h index 48f1cc1e..0d1e99fe 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -257,6 +257,6 @@ std::size_t hash_seed(std::size_t seed); * @param p Path to convert * @return String representation of the path in URL format */ -std::string path_to_url(const std::filesystem::path& p); +std::string path_to_url(const std::filesystem::path &p); } // namespace clanguml::util \ No newline at end of file diff --git a/tests/test_model.cc b/tests/test_model.cc index 0857422f..05ebd01e 100644 --- a/tests/test_model.cc +++ b/tests/test_model.cc @@ -21,7 +21,6 @@ #include "common/model/namespace.h" - TEST_CASE("Test namespace_", "[unit-test]") { using clanguml::common::model::namespace_;