Page MenuHomePhabricator

Clang format style for * and & at variables
Open, HighPublic


Currently our clang format file seems to enforce

type *name

while most of our code base is

type* name

this generates a lot of code noise in diffs if using features in VS2019 to auto format directly.

Further I think the style in the code base

type* name

makes more sense nowadays, because I would put the priority on method signatures and not on c-ish data definitions.

Want to discuss and clarify it.

Related Objects

Event Timeline

floca triaged this task as High priority.Mar 4 2020, 9:46 AM
floca created this task.
floca moved this task from Backlog to MITK Meeting on the Request for Discussion board.
kalali added a subscriber: kalali.Mar 4 2020, 11:57 AM

Agree, but I also recommend to disable the auto-formatting in VS2019, as we had quite some inconsistencies in the past with it. When we agreed on a final clang-format, we should apply it to the whole code base (master) and after that look into reenabling the feature in VS2019.

floca added a comment.Mar 5 2020, 11:39 AM

Complete agreement.

floca updated the task description. (Show Details)Mar 5 2020, 11:39 AM
kislinsk added a subscriber: nolden.

We should meet and discuss about conventions in detail, before we apply a repository wide reformat. @nolden @kalali @floca

Marco's suggestion: Try with master branch first and then decide if we apply for big topic branches.