Skip to content

Commit

Permalink
fixed #13627 - bail out on nested GUI projects instead of ignoring th…
Browse files Browse the repository at this point in the history
…em silently
  • Loading branch information
firewave committed Feb 7, 2025
1 parent d0f24fe commit fb5f293
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cli/cmdlineparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,10 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
// read underlying project
projectFile = projectFileGui;
projType = project.import(projectFileGui, &mSettings, &mSuppressions);
if (projType == ImportProject::Type::CPPCHECK_GUI) {
mLogger.printError("nested Cppcheck GUI projects are not supported.");
return Result::Fail;
}
}
}
if (projType == ImportProject::Type::VS_SLN || projType == ImportProject::Type::VS_VCXPROJ) {
Expand Down
2 changes: 1 addition & 1 deletion test/cli/more-projects_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ def test_project_file_nested(tmp_path):

args = ['--project={}'.format(level1_file)]
out_lines = [
'cppcheck: error: no C or C++ source files found.'
'cppcheck: error: nested Cppcheck GUI projects are not supported.'
]

assert_cppcheck(args, ec_exp=1, err_exp=[], out_exp=out_lines)

0 comments on commit fb5f293

Please sign in to comment.