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.

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.

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.

kislinsk added a project: Auto-closed.

Hi there! ๐Ÿ™‚

This task was auto-closed according to our Task Lifecycle Management.
Please follow this link for more information and don't forget that you are encouraged to reasonable re-open tasks to revive them. ๐Ÿš‘

Best wishes,
The MITK devs

floca removed a project: Auto-closed.

there is a DerivePointerAlignment option which basically unifies it on a file by file basis, in case there is no agreement. But I agree to Ralf with using the "left" style and put it next to the type