Skip to content

Commit 13296c7

Browse files
update CONTRIBUTING.md
1 parent 7687223 commit 13296c7

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
## Table of Contents
44

55
- [Rules](#rules)
6-
- [Variable naming](#variable-naming) <sup>[justification](#justification)</sup>
76
- [Type annotation](#type-annotation)
87
- [Protocols](#protocols)
9-
- [Variables](#variables) <sup>[exceptions](#exceptions) | [justification](#justification-1)</sup>
10-
- [Extensions](#extensions) <sup>[justification](#justification-2)</sup>
8+
- [Variables](#variables) <sup>[exceptions](#exceptions) | [justification](#justification)</sup>
119
- [Documentation](#documentation)
1210

1311
## Rules
@@ -18,23 +16,15 @@ You can format your code running `swift format` with our given format file. Due
1816

1917
At the end of the day, you can write however you want. The maintainers will modify the syntax after merging.
2018

21-
### Variable naming
22-
23-
All public facing functions and variables should use `lowerCamelCase`. Non-public functions and variables should use `snake_case`, but it is not required. Snake case is recommended for `package`, `private` and `fileprivate` declarations.
24-
25-
#### Justification
26-
27-
`lowerCamelCase` is recommended by the Swift Language. `snake_case` is more readable and maintainable with larger projects.
28-
2919
### Type annotation
3020

3121
Declaring a native Swift type never contains spaces. The only exception is type aliases.
3222

33-
Example: declaring a dictionary should look like `[String:String]` instead of `Dictionary<String, String>`.
23+
Example: declaring a dictionary should look like `[String:String]` instead of `[String : String]` (and `Dictionary<String, String>`).
3424

3525
#### Protocols
3626

37-
As protocols outline an implementation, conformances and variables should always be separated by a single space between each token. Conformances should always be sorted alphabetically.
27+
As protocols outline an implementation, conformances and variables should always be 1 line and separated by a single space between each token. Conformances should always be sorted alphabetically.
3828

3929
```swift
4030
// ✅ DO
@@ -113,14 +103,6 @@ var headers : [String:String] {
113103

114104
Reduces syntax noise, improves readability
115105

116-
### Extensions
117-
118-
If you're making an `extension` where all content is the same visibility: declare the visibility at the extension level. There are no exceptions.
119-
120-
#### Justification
121-
122-
Waste of disk space to declare the same visibility for every declaration.
123-
124106
### Documentation
125107

126108
Documenting your code is required if you have justification for a change or implementation, otherwise it is not required (but best practice to do so).

0 commit comments

Comments
 (0)