Fix #13556 (Import project: exclude missing files)#7644
Fix #13556 (Import project: exclude missing files)#7644firewave merged 6 commits intocppcheck-opensource:mainfrom
Conversation
|
This needs to at least generate a warning if a file does not exist. Otherwise you could be unintentionally not analyzing files which would be a security concern. |
Warnings for missing files are emitted when the checking is done, as it is for other project types. This change removes the failure to import which only happens for json projects. |
Then the tests which were removed should be restored and adjusted to reflect that. |
|
|
||
| ret, _, stderr = cppcheck(["--project=" + str(project_file)]) | ||
| assert 0 == ret | ||
| assert f"{missing_file}:1:0: error: File is missing: {missing_file_posix} [syntaxError]\n\n^\n" == stderr |
There was a problem hiding this comment.
Something for later - we should give this its own ID.
There was a problem hiding this comment.
Yeah this caught me off-guard, but it's beyond the scope of this pr.
There was a problem hiding this comment.
Some of the changes related to this behavior have been a bit bandaid-y but there is big picture stuff. Which is why I am on the fence on some of these when they appear to be low-hanging fruits (if they actually were I would have posted fixes). I want to prevent multiple behavior changes for users like we have here that they now need to suppress syntaxError and will have to suppress a different ID in the future - and with the unmatched suppression handling still partially broken, it is a different can of worms (things are quite interconnected)...but I digress.
danmar
left a comment
There was a problem hiding this comment.
lgtm.
I agree the ID should be changed.. however it must be a "critical error id".
No description provided.