Cppcheck is the tool which analyses our CPP code. I want to create custom rule for Cppcheck to check whether all functions have comments or not. For that I need a PCRE (Pearl regex) pattern. Or any other predefined rules to address this scenarios.
Asked
Active
Viewed 848 times
1
-
And what is your question EXACTLY? – Grzegorz Adam Kowalski May 21 '14 at 08:20
-
We can implement this rule for you in PVS-Studio. – May 21 '14 at 10:35
-
Did you try [doxygen](http://www.stack.nl/~dimitri/doxygen/manual/index.html)? It's more appropriate for this purpose. – Wolf Jun 06 '14 at 05:48
2 Answers
0
There are some predefined rules available @ installerlocation\cfg, what is the purpose of it? whether we can write rules using it instead of tools?

Nethaji
- 49
- 2
- 6
0
I am a cppcheck author. Yes, you can write rules using PCRE expressions. But as far as I know you can't see if there are comments from a rule. As far as I know, all comments and indentation are removed before any rules are executed.

Daniel Marjamäki
- 2,907
- 15
- 16
-
Is this caused by the tokenizing step that is done before cppcheck applies its rules? May it be possible that there is a "pseudo-token" for comments? Or are comments simply added to the (optional) white-space between tokens? BTW: An early *no* would make it a more pragmatic answer. – Wolf Jun 06 '14 at 05:46