Miscellaneous-NoFunctionCommentInImpl

Do not place comments above functions and methods in implementation files

Required inputs: IR

Function documentation should be placed above the function declaration in the header file. The documentation should not be duplicated in the implementation file.

Possible Messages

Key

Text

Severity

Disabled

comment_in_funcimpl

Use of function/method comment in implementation file.

None

False

Options

stop_tokens

stop_tokens : set[str] = {'#define', '#include', ';', '{', '}'}

When searching upwards or downwards for comment tokens, the search will stop when encountering one of these stop tokens. The semicolon is special when searching downwards as the search will not stop for the first semicolon that i.e. ends a block. Without #include as stop token, leading comments in a file have been frequently mistaken as comments of the first definition. The former default value did not include #include. Other sensible stop tokens may be #pragma, #if, #idef, #ifndef and #endif.