Fix check for misra addon in executeAddons. (#3819)

In the CppCheck::executeAddons function, a check that specifically tests
for the misra add-on, was not taking into account the cases when the
addon is identified with the '.py' extension or indirectly via json.
This resulted in the add-on not being executed a second time which is
needed to detected some of the misra violations. By using the AddonInfo
class name field, the addon name is uniformized for all these cases and
the add-on executed a second time.

Signed-off-by: Jose Martins <josemartins90@gmail.com>
This commit is contained in:
José Martins 2022-02-13 10:58:42 +00:00 committed by GitHub
parent f2420509c9
commit c8211ec6f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1366,7 +1366,7 @@ void CppCheck::executeAddons(const std::vector<std::string>& files)
mExitCode = 1;
continue;
}
if (addon != "misra" && !addonInfo.ctu && endsWith(files.back(), ".ctu-info"))
if (addonInfo.name != "misra" && !addonInfo.ctu && endsWith(files.back(), ".ctu-info"))
continue;
const std::string results =