A bit of context: I use cppcheck through cmake with the CMAKE_CXX_CPPCHECK variable. It cause cmake to call cppcheck for every file it compiles.
The main advandage is that includes and defines send to the compiler are also sent to cppcheck.
The drawback is that cppcheck is call for each file and not for the whole project so I get as many xml files as source files. (And of course warning such as unusedFunction are irrelevant).
For now I "hacked" my way by merging all the xml files into a big one but it is not a very satisfyng solution. And it is far from perfect since issues from headers are duplicated as many times as the header is included.
The evolutions I have in mind for the htmlreports would be: allow multiple "--file" parameters add a "--xml-dir"
After the xml-parsing a duplicate removal will probably be needed.
There will also be the behaviour of reading from stdin to be clarified: does sending multiple xml files to stdin allowed ("cat xml-report/* | htmlreports").
With current version it reports junk when starting parsing the second file. (I also had to comment a option parser error complaining about the lack of "--file" option).
Tell me if it's an evolution that might interest other people. Python is not my main programming language but I can try to have a go at this change.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A bit of context: I use cppcheck through cmake with the CMAKE_CXX_CPPCHECK variable. It cause cmake to call cppcheck for every file it compiles.
The main advandage is that includes and defines send to the compiler are also sent to cppcheck.
The drawback is that cppcheck is call for each file and not for the whole project so I get as many xml files as source files. (And of course warning such as unusedFunction are irrelevant).
For now I "hacked" my way by merging all the xml files into a big one but it is not a very satisfyng solution. And it is far from perfect since issues from headers are duplicated as many times as the header is included.
The evolutions I have in mind for the htmlreports would be:
allow multiple "--file" parameters
add a "--xml-dir"
After the xml-parsing a duplicate removal will probably be needed.
There will also be the behaviour of reading from stdin to be clarified: does sending multiple xml files to stdin allowed ("cat xml-report/* | htmlreports").
With current version it reports junk when starting parsing the second file. (I also had to comment a option parser error complaining about the lack of "--file" option).
Tell me if it's an evolution that might interest other people. Python is not my main programming language but I can try to have a go at this change.
Today I've experienced this situation and tested this options too.
Finally, I've implemented the support for multiple xml files and I've also fixed the bug parsing the stdin.
Now, You can parse one or several files or the standard input (with just ONE xml).
I attach my proposed patch.
thanks! I wonder if you can open a github pull request instead that would be best for us.