Skip to content

Commit

Permalink
style: pre-commit.ci fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jan 13, 2025
1 parent 797e177 commit de7c90c
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions include/CLI/TypeTools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -968,9 +968,8 @@ bool integral_conversion(const std::string &input, T &output) noexcept {
nstring.erase(std::remove(nstring.begin(), nstring.end(), '\''), nstring.end());
return integral_conversion(nstring, output);
}
if (std::isspace(static_cast<unsigned char>(input.back())))
{
return integral_conversion(trim_copy(input),output);
if(std::isspace(static_cast<unsigned char>(input.back()))) {
return integral_conversion(trim_copy(input), output);

Check warning on line 972 in include/CLI/TypeTools.hpp

View check run for this annotation

Codecov / codecov/patch

include/CLI/TypeTools.hpp#L972

Added line #L972 was not covered by tests
}
if(input.compare(0, 2, "0o") == 0 || input.compare(0, 2, "0O") == 0) {
val = nullptr;
Expand Down Expand Up @@ -1027,9 +1026,8 @@ bool integral_conversion(const std::string &input, T &output) noexcept {
nstring.erase(std::remove(nstring.begin(), nstring.end(), '\''), nstring.end());
return integral_conversion(nstring, output);
}
if (std::isspace(static_cast<unsigned char>(input.back())))
{
return integral_conversion(trim_copy(input),output);
if(std::isspace(static_cast<unsigned char>(input.back()))) {
return integral_conversion(trim_copy(input), output);
}
if(input.compare(0, 2, "0o") == 0 || input.compare(0, 2, "0O") == 0) {
val = nullptr;
Expand Down Expand Up @@ -1155,14 +1153,13 @@ bool lexical_cast(const std::string &input, T &output) {
if(val == (input.c_str() + input.size())) {
return true;
}
while (std::isspace(static_cast<unsigned char>(*val)))
{
++val;
if(val == (input.c_str() + input.size())) {
return true;
}
while(std::isspace(static_cast<unsigned char>(*val))) {
++val;
if(val == (input.c_str() + input.size())) {
return true;
}
}

// remove separators
if(input.find_first_of("_'") != std::string::npos) {
std::string nstring = input;
Expand Down

0 comments on commit de7c90c

Please sign in to comment.