Skip to content

[packages] Pick an Obj-C comment style #143868

@stuartmorgan-g

Description

@stuartmorgan-g

It came up in a recent review that our commenting style for declaration comments in Obj-C code in flutter/packages is not consistent. It's not even consistent within a given package, or in some cases within a file (I'm looking at you camera). Some use /** */, and other use ///

The main arguments I'm aware of for each in our case:

  • /** */
    • It's what every example in the Google Obj-C style guide uses.
  • ///
    • It's what Dart uses.
    • It's what the Swift style guide uses.
    • It's what current versions of Xcode seem to use if you ask it to add a documentation comment.

(Unless I messed up my grep, there's no clear current dominant style; it looks like ~850 ///s and ~650 /**/*/ */s.)

I could mass fix this once there's a decision to avoid the inconsistency continuing to spread. I don't have a strong opinion about which to use (but if nobody else does either, I would lean toward /// given the list above).

Metadata

Metadata

Labels

P3Issues that are less important to the Flutter projectpackageflutter/packages repository. See also p: labels.team-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions