Fixed clang-tidy warnings
This commit is contained in:
@@ -72,12 +72,13 @@ void progress_indicator::increment(const std::string &name)
|
|||||||
|
|
||||||
auto &p = progress_bar_index_.at(name);
|
auto &p = progress_bar_index_.at(name);
|
||||||
auto &bar = progress_bars_[p.index];
|
auto &bar = progress_bars_[p.index];
|
||||||
progress_bars_mutex_.unlock();
|
|
||||||
|
|
||||||
p.progress++;
|
p.progress++;
|
||||||
|
|
||||||
bar.set_progress((p.progress * kASTTraverseProgressPercent) / p.max);
|
bar.set_progress((p.progress * kASTTraverseProgressPercent) / p.max);
|
||||||
bar.set_option(indicators::option::PostfixText{
|
bar.set_option(indicators::option::PostfixText{
|
||||||
fmt::format("{}/{}", p.progress, p.max)});
|
fmt::format("{}/{}", p.progress, p.max)});
|
||||||
|
progress_bars_mutex_.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void progress_indicator::stop()
|
void progress_indicator::stop()
|
||||||
@@ -104,7 +105,6 @@ void progress_indicator::complete(const std::string &name)
|
|||||||
|
|
||||||
auto &p = progress_bar_index_.at(name);
|
auto &p = progress_bar_index_.at(name);
|
||||||
auto &bar = progress_bars_[p.index];
|
auto &bar = progress_bars_[p.index];
|
||||||
progress_bars_mutex_.unlock();
|
|
||||||
|
|
||||||
bar.set_progress(kCompleteProgressPercent);
|
bar.set_progress(kCompleteProgressPercent);
|
||||||
|
|
||||||
@@ -117,6 +117,8 @@ void progress_indicator::complete(const std::string &name)
|
|||||||
bar.set_option(
|
bar.set_option(
|
||||||
indicators::option::ForegroundColor{indicators::Color::green});
|
indicators::option::ForegroundColor{indicators::Color::green});
|
||||||
bar.mark_as_completed();
|
bar.mark_as_completed();
|
||||||
|
|
||||||
|
progress_bars_mutex_.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void progress_indicator::fail(const std::string &name)
|
void progress_indicator::fail(const std::string &name)
|
||||||
@@ -124,7 +126,6 @@ void progress_indicator::fail(const std::string &name)
|
|||||||
progress_bars_mutex_.lock();
|
progress_bars_mutex_.lock();
|
||||||
auto &p = progress_bar_index_.at(name);
|
auto &p = progress_bar_index_.at(name);
|
||||||
auto &bar = progress_bars_[p.index];
|
auto &bar = progress_bars_[p.index];
|
||||||
progress_bars_mutex_.unlock();
|
|
||||||
|
|
||||||
#if _MSC_VER
|
#if _MSC_VER
|
||||||
const auto postfix_text = fmt::format("{}/{} FAILED", p.progress, p.max);
|
const auto postfix_text = fmt::format("{}/{} FAILED", p.progress, p.max);
|
||||||
@@ -134,6 +135,8 @@ void progress_indicator::fail(const std::string &name)
|
|||||||
bar.set_option(indicators::option::ForegroundColor{indicators::Color::red});
|
bar.set_option(indicators::option::ForegroundColor{indicators::Color::red});
|
||||||
bar.set_option(indicators::option::PostfixText{postfix_text});
|
bar.set_option(indicators::option::PostfixText{postfix_text});
|
||||||
bar.mark_as_completed();
|
bar.mark_as_completed();
|
||||||
|
|
||||||
|
progress_bars_mutex_.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace clanguml::common::generators
|
} // namespace clanguml::common::generators
|
||||||
@@ -83,4 +83,4 @@ std::string map_type_parameter_to_template_parameter_name(
|
|||||||
return type_parameter;
|
return type_parameter;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace clanguml::class_diagram::visitor
|
} // namespace clanguml::common::visitor
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ public:
|
|||||||
void build(
|
void build(
|
||||||
clanguml::common::model::template_element &template_instantiation,
|
clanguml::common::model::template_element &template_instantiation,
|
||||||
const clang::NamedDecl *cls, const clang::TemplateDecl *template_decl,
|
const clang::NamedDecl *cls, const clang::TemplateDecl *template_decl,
|
||||||
const clang::ArrayRef<clang::TemplateArgument> template_arguments,
|
clang::ArrayRef<clang::TemplateArgument> template_arguments,
|
||||||
std::string full_template_specialization_name,
|
std::string full_template_specialization_name,
|
||||||
std::optional<clanguml::common::model::template_element *> parent = {});
|
std::optional<clanguml::common::model::template_element *> parent = {});
|
||||||
|
|
||||||
|
|||||||
@@ -325,7 +325,8 @@ common::id_t translation_unit_visitor::get_package_id(const clang::Decl *cls)
|
|||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
else if (config().package_type() == config::package_type_t::kModule) {
|
|
||||||
|
if (config().package_type() == config::package_type_t::kModule) {
|
||||||
const auto *module = cls->getOwningModule();
|
const auto *module = cls->getOwningModule();
|
||||||
if (module != nullptr) {
|
if (module != nullptr) {
|
||||||
std::string module_path = module->Name;
|
std::string module_path = module->Name;
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ translation_unit_visitor::translation_unit_visitor(clang::SourceManager &sm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<sequence_diagram::model::class_>
|
std::unique_ptr<sequence_diagram::model::class_>
|
||||||
translation_unit_visitor::create_element(const clang::NamedDecl *decl) const
|
translation_unit_visitor::create_element(
|
||||||
|
const clang::NamedDecl * /*decl*/) const
|
||||||
{
|
{
|
||||||
return std::make_unique<sequence_diagram::model::class_>(
|
return std::make_unique<sequence_diagram::model::class_>(
|
||||||
config().using_namespace());
|
config().using_namespace());
|
||||||
|
|||||||
Reference in New Issue
Block a user