You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -18,23 +16,15 @@ You can format your code running `swift format` with our given format file. Due
18
16
19
17
At the end of the day, you can write however you want. The maintainers will modify the syntax after merging.
20
18
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
-
29
19
### Type annotation
30
20
31
21
Declaring a native Swift type never contains spaces. The only exception is type aliases.
32
22
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>`).
34
24
35
25
#### Protocols
36
26
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.
38
28
39
29
```swift
40
30
// ✅ DO
@@ -113,14 +103,6 @@ var headers : [String:String] {
113
103
114
104
Reduces syntax noise, improves readability
115
105
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
-
124
106
### Documentation
125
107
126
108
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