Fixed clang-tidy warnings

This commit is contained in:
Bartek Kryza
2023-03-11 22:06:53 +01:00
parent e7353d7a03
commit bcba612f65
4 changed files with 13 additions and 14 deletions

View File

@@ -56,7 +56,7 @@ void cli_handler::setup_logging()
}
}
cli_flow_t cli_handler::parse(int argc, const char *argv[])
cli_flow_t cli_handler::parse(int argc, const char **argv)
{
app.add_option("-c,--config", config_path,
"Location of configuration file, when '-' read from stdin");
@@ -104,7 +104,7 @@ cli_flow_t cli_handler::parse(int argc, const char *argv[])
return cli_flow_t::kExit;
}
catch (const CLI::ParseError &e) {
exit(app.exit(e));
exit(app.exit(e)); // NOLINT(concurrency-mt-unsafe)
}
if (quiet || dump_config)
@@ -115,7 +115,7 @@ cli_flow_t cli_handler::parse(int argc, const char *argv[])
return cli_flow_t::kContinue;
}
cli_flow_t cli_handler::handle_options(int argc, const char *argv[])
cli_flow_t cli_handler::handle_options(int argc, const char **argv)
{
auto res = parse(argc, argv);
@@ -558,4 +558,4 @@ cli_flow_t cli_handler::print_config()
return cli_flow_t::kExit;
}
} // namespace clanguml::options
} // namespace clanguml::cli

View File

@@ -41,7 +41,7 @@ public:
* @param argv
* @return
*/
cli_flow_t handle_options(int argc, const char *argv[]);
cli_flow_t handle_options(int argc, const char **argv);
/**
* Print the program version and basic information
@@ -135,7 +135,7 @@ public:
clanguml::config::config config;
private:
cli_flow_t parse(int argc, const char *argv[]);
cli_flow_t parse(int argc, const char **argv);
cli_flow_t handle_pre_config_options();
@@ -149,5 +149,4 @@ private:
std::shared_ptr<spdlog::logger> logger_;
CLI::App app{"Clang-based UML diagram generator for C++"};
};
} // namespace clanguml::options
} // namespace clanguml::cli

View File

@@ -140,14 +140,14 @@ diagram_t from_string(const std::string &s)
{
if (s == "class")
return diagram_t::kClass;
else if (s == "sequence")
if (s == "sequence")
return diagram_t::kSequence;
else if (s == "include")
if (s == "include")
return diagram_t::kInclude;
else if (s == "package")
if (s == "package")
return diagram_t::kPackage;
else
throw std::runtime_error{"Invalid diagram type: " + s};
throw std::runtime_error{"Invalid diagram type: " + s};
}
} // namespace clanguml::common::model

View File

@@ -52,7 +52,7 @@ struct plantuml {
struct diagram_template {
std::string description;
common::model::diagram_t type;
common::model::diagram_t type{common::model::diagram_t::kClass};
std::string jinja_template;
};