Munkei/atom-linter-cppcheck

using MissingInclude and UnusedFunction causes cppcheck not to run

Closed this issue · 3 comments

I had to create some console logging to determine what command and args were being run to troubleshoot why cppcheck was not finding errors. I realized that when using MissingInclude and UnusedFunction checks I was getting the following error (when running via command line to reproduce the problem):
cppcheck: there is no --enable parameter with the name 'missinginclude'
cppcheck: there is no --enable parameter with the name 'unusedfunction'

The problem here is the parameter is not camelCase (ie. missingInclude works).

In linter-cppcheck.js you lower case the enables string and therefor the entire parameter is lower case.

1.) Can you use something like this to get the correct case:
enables.push(enable.charAt(0).toLowerCase() + enable.slice(1));

2.) Also, can you add some logging so that we can troubleshoot better what is going on.

Thanks,
Trevor

Interesting find, I'll see what I can do.

Thanks for the reply. It would also be great if the cppcheck wouldn't fail silently.
Due a copy/paste error on my part (I had "--suppress=...." inside of the "Supress" input box so the command actually had something like:
"--suppress=--suppress=:/otlv4.h"
Cppcheck reported a failure but the cppcheck linter seemed to not have any issues. I am not sure if there is a error status/return code that can be checked or if you would have to parse the output from cppcheck for 'Failure' but it would be nice to have some verification that the cppcheck is not working when there is an error.
Thanks again.

This has now been fixed and released in v0.2.1.