Skip to content

Commit 32526d8

Browse files
amartini51Colleen Toporek
andcommitted
Add style guide entry for comment formatting
Co-authored-by: Colleen Toporek <colleen_toporek@apple.com>
1 parent 71b395b commit 32526d8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Style.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,18 @@ in the reference, omit it.
107107

108108
Spelled as two words, not closed up or hyphenated.
109109

110+
## comments
111+
112+
Prefer full sentences for comments in code.
113+
End with a period, even when it's a fragment.
114+
When contrasting code that works and code that doesn't,
115+
format the comments with a colon as follows:
116+
117+
```
118+
// OK: Evaluates to true.
119+
// Error: Value consumed more than once.
120+
```
121+
110122
## compiler, the
111123

112124
See entry for *Swift*.

0 commit comments

Comments
 (0)