Check specific Visual Studio configurations#2503
Conversation
danmar
left a comment
There was a problem hiding this comment.
thanks. this is probably 95% good.
I think I need to build and test it..
| const char MaxCtuDepthElementName[] = "max-ctu-depth"; | ||
| const char CheckUnknownFunctionReturn[] = "check-unknown-function-return-values"; | ||
| const char Name[] = "name"; | ||
| const char VSConfigurationElementName[] = "vsconfigurations"; |
There was a problem hiding this comment.
The variable names are fine. But the xml elements normally use "-" to separate names. So maybe "vs-configurations" and "config" are good names.
|
Ok I'll update the names.
Daniel Marjamäki <notifications@github.com> schrieb am Sa., 25. Jan. 2020,
10:11:
… ***@***.**** commented on this pull request.
thanks. this is probably 95% good.
I think I need to build and test it..
------------------------------
In lib/importproject.h
<#2503 (comment)>:
> @@ -153,6 +154,8 @@ namespace CppcheckXml {
const char MaxCtuDepthElementName[] = "max-ctu-depth";
const char CheckUnknownFunctionReturn[] = "check-unknown-function-return-values";
const char Name[] = "name";
+ const char VSConfigurationElementName[] = "vsconfigurations";
The variable names are fine. But the xml elements normally use "-" to
separate names. So maybe "vs-configurations" and "config" are good names.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2503>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQTYQY4KFJ4PLZSF7NIH43Q7P64ZANCNFSM4KLFXBNA>
.
|
…k_specific_VS_config
|
I assume this technically is working but maybe the UI can be tweaked. For me it is confusing what happens if I both click on "Analyze all visual studio solutions" and write something in the edit box. If "analyze all visual studio solutions" is checked I suggest that the editbox is disabled. Somehow it would be good if the available configurations is listed. Do you want to be able to analyze several configurations but not all? If you are fine analyzing 1 configuration then a combobox could be used. |
|
I changed the behavior as suggested. If you select "Analyze all visual studio configurations" then the textbox is disabled. I think it would be nice to define multiple configurations so a semicolon separated list would make more sense here. |
That is true. But that would be pretty simple to add. Then create a utility function like: And then in I have the feeling that it's more difficult to tweak the GUI. In my head I would like that the user could select configurations somehow. It would be very easy to miswrite a configuration if they are not listed or checked at all. What happens then, Cppcheck will not write any warning? And can't the configurations contain semicolon also? |
|
I am grateful that you are working on this. It will be a really cool enhancement! |
|
You're welcome :) I updated the importer to automatically read all different configurations. The UI was updated too. I replaced the textbox with a QListWidget so the user can multi-select configurations |
…jb/cppcheck into check_specific_VS_config
| if (p.platform != ProjectConfiguration::Unknown) | ||
| if (p.platform != ProjectConfiguration::Unknown) { | ||
| projectConfigurationList.emplace_back(cfg); | ||
| bool alreadyIn = false; |
There was a problem hiding this comment.
hmm.. I envisioned that this would be kept out of importVcxproj.
std::set<std::string> ImportProject::getVSConfigs() const {
std::set<std::string> ret;
for (const FileSettings &fs: fileSettings)
ret.insert(fs.cfg);
return ret;
}
Cool.. will take a look soon |
|
I merged this, it works good enough for merge. But I think you can tweak it better.
|
|
I created a new PR with some tiny fixed that should fix this. |
Add support to check against selected Visual Studio configurations in a cppcheck project file.
The cppcheck project file format was extended with a potential list of VS configurations. On importing a Visual Studio solution or project file from a .cppcheck file only those configurations that match the ones in the list are checked.