I'm new in cppcheck. I just want to use it to check some coding style issue, for example,
void checknameis(); // bad style and should give an message
void checkNameIs(); // good style
or
int num;// bad style and should give an message
int pNum; // good style
can I enable cppcheck to do such check?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
if you put the json configuration in a file called "naming.json" then that should be automatically read by the addon. The addon contains a bit of documentation.
Warning about "checknameis" would probably need that it contains some kind of dictionary. As far as I know there is no functionality for that but it is a script so it can be added.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thanks alot,Where should I view the documentation about naming? In addition, I found that cppcheck on my side does not check. H files. Is there any restriction in the code? Where is it? Can I let go?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm new in cppcheck. I just want to use it to check some coding style issue, for example,
void checknameis(); // bad style and should give an message
void checkNameIs(); // good style
or
int num;// bad style and should give an message
int pNum; // good style
can I enable cppcheck to do such check?
It seems to me you want to check the naming of functions and variables. We have an addon called namingng that should be helpful.
https://github.com/danmar/cppcheck/blob/main/addons/namingng.py
Basic usage seems to be:
if you put the json configuration in a file called "naming.json" then that should be automatically read by the addon. The addon contains a bit of documentation.
Warning about "checknameis" would probably need that it contains some kind of dictionary. As far as I know there is no functionality for that but it is a script so it can be added.
thanks alot,Where should I view the documentation about naming? In addition, I found that cppcheck on my side does not check. H files. Is there any restriction in the code? Where is it? Can I let go?
And what is the format in the JSON file?