Skip to content

In-code code review comments

Proposal

While working on a project you would sometimes want to consult your team mates on how to implement specific piece of code. It's like you would want to add code review comment by yourself, which you can eventually do, but you have to wait till you push your changes and create merge request. It's easy to forget all the little doubts you might have and questionable fragment of code can be lost in the bulk of a push.

I think it would be great if we had mechanism somewhat similar to TODO comments, which are nowadays interpreted by IDEs and documentation generators to help you track todos, but targeted at the code review level. Such comments could be interpreted by GitLab and turned into code review comments. Before the merge all such comments would need to be removed. Optionally GitLab could refuse to merge a branch with TODO, FIXME and similar comments.

Use case examples:

// CODEREVIEW: should this function return Future<bool?> or rather Future<bool>?
Future<bool?> test() {
    return someFuture()
 .then((value) => Future<bool?>.value(value))
 .catchError((e) {
    return null;
});
if (!ptr)
    // @codereview should we use abort() or rather exit() here?
    std::abort();

I know this is pretty large and complex, hence I would want to know your opinion. Just an idea.

Edited by Michal Policht