Skip to content

Consider throwing "definition without comment" errors only for definitions in header files #1

@sergepetrenko

Description

@sergepetrenko

There are lots of small undocumented helpers in our source files.
For example, see src/box/replication.cc.
Adding new similar helpers triggers the "definition without comment" error.
IMO such helpers don't need any explanation, especially when they are added to a file which already has a ton of functions alike.

I propose to only check definition without comment in header files, e.g. for public functions.

By the way, headers also have this problem. Some functions are hard to document, because they are pretty self-explanatory, and re-writing the function name in comment is tautological. Examples:
src/box/replication.h

void                                                                             
replication_init(int num_threads);                                                        
                                                                                 
void                                                                             
replication_free(void);  

struct replica *                                                                 
replicaset_first(void);                                                          
                                                                                 
struct replica *                                                                 
replicaset_next(struct replica *replica);

and many more.

However, I understand that silencing the check for headers would be excess.

Alternatively, we may consider adding some silencing comment. Like /* Nocomment. */. Which looks quite ugly IMO.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions