Skip to content

Commit 7f46f7d

Browse files
committed
Merge pull request #1006 from facebook/objc-style-guide
Add some common objc nits to the style guide
2 parents b99744a + 5db06ac commit 7f46f7d

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

CONTRIBUTING.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,27 @@ Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
5252

5353
### Code
5454

55-
* Use semicolons;
55+
#### General
56+
5657
* Add trailing commas,
5758
* 2 spaces for indentation (no tabs)
58-
* Prefer `'` over `"`
59-
* `'use strict';`
60-
* 80 character line length
6159
* "Attractive"
60+
61+
#### JavaScript
62+
63+
* Use semicolons;
64+
* `'use strict';`
65+
* Prefer `'` over `"`
6266
* Do not use the optional parameters of `setTimeout` and `setInterval`
67+
* 80 character line length
68+
69+
#### Objective-C
70+
71+
* Space after `@property` declarations
72+
* Brackets on *every* `if`, on the *same* line
73+
* `- method`, `@interface`, and `@implementation` brackets on the following line
74+
* *Try* to keep it around 80 characters line length (sometimes it's just not possible...)
75+
* `*` operator goes with the variable name (e.g. `NSObject *variableName;`)
6376

6477
### Documentation
6578

0 commit comments

Comments
 (0)