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 Oct 28, 2023
1 parent 606f147 commit 4c98bd8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 24 deletions.
10 changes: 5 additions & 5 deletions .codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ engines:
languages:

exclude_paths:
- 'fuzz/**/*'
- 'fuzz/*'
- 'scripts/**/*'
- 'scripts/*'
- '**.md'
- "fuzz/**/*"
- "fuzz/*"
- "scripts/**/*"
- "scripts/*"
- "**.md"
24 changes: 8 additions & 16 deletions include/CLI/impl/Config_inl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,28 +423,20 @@ ConfigBase::to_config(const App *app, bool default_also, bool write_description,

if(!value.empty()) {
if(!opt->get_fnames().empty()) {
try
{
try {
value = opt->get_flag_value(name, value);
}
catch (const CLI::ArgumentMismatch&)
{
} catch(const CLI::ArgumentMismatch &) {
bool valid{false};
for (const auto& test_name : opt->get_fnames())
{
try
{
for(const auto &test_name : opt->get_fnames()) {
try {
value = opt->get_flag_value(test_name, value);
name=test_name;
valid=true;
}
catch (const CLI::ArgumentMismatch&)
{
name = test_name;
valid = true;
} catch(const CLI::ArgumentMismatch &) {
continue;
}
}
if (!valid)
{
if(!valid) {
throw;

Check warning on line 440 in include/CLI/impl/Config_inl.hpp

View check run for this annotation

Codecov / codecov/patch

include/CLI/impl/Config_inl.hpp#L440

Added line #L440 was not covered by tests
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/FuzzFailTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ TEST_CASE("app_file_gen_fail") {
auto app = fuzzdata.generateApp();

int index = GENERATE(range(1, 4));
std::string optionString,flagString;
std::string optionString, flagString;
auto parseData = loadFailureFile("fuzz_app_file_fail", index);
if(parseData.size() > 25) {
optionString = parseData.substr(0, 25);
Expand Down
2 changes: 1 addition & 1 deletion tests/fuzzFail/fuzz_app_file_fail2
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-c
-c
2 changes: 1 addition & 1 deletion tests/fuzzFail/fuzz_app_file_fail3
Original file line number Diff line number Diff line change
@@ -1 +1 @@
`--vM```-````-c`
`--vM```-````-c`

0 comments on commit 4c98bd8

Please sign in to comment.