Skip to content

Commit 2f71242

Browse files
authored
Merge pull request #919 from DimaMishchenko/main
Document missing configuration
2 parents f9b10f2 + 4bba23b commit 2f71242

File tree

1 file changed

+84
-4
lines changed

1 file changed

+84
-4
lines changed

Documentation/Configuration.md

Lines changed: 84 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,40 @@ top-level keys and values:
137137

138138
---
139139

140-
## FIXME: fileScopedDeclarationPrivacy
140+
## `fileScopedDeclarationPrivacy`
141+
**type:** object
142+
143+
**description:** Declarations at file scope with effective private access should be consistently declared as either `fileprivate` or `private`, determined by configuration.
144+
145+
- `accessLevel` _(string)_: The formal access level to use when encountering a file-scoped declaration with effective private access. Allowed values are `private` and `fileprivate`.
146+
147+
**default:** `{ "accessLevel" : "private" }`
141148

142149
---
143150

144-
### FIXME: indentSwitchCaseLabels
151+
### `indentSwitchCaseLabels`
152+
**type:** boolean
153+
154+
**description:** Determines if `case` statements should be indented compared to the containing `switch` block.
155+
156+
When `false`, the correct form is:
157+
```swift
158+
switch someValue {
159+
case someCase:
160+
someStatement
161+
...
162+
}
163+
```
164+
When `true`, the correct form is:
165+
```swift
166+
switch someValue {
167+
case someCase:
168+
someStatement
169+
...
170+
}
171+
```
172+
173+
**default:** `false`
145174

146175
---
147176

@@ -154,7 +183,14 @@ top-level keys and values:
154183

155184
---
156185

157-
### FIXME: noAssignmentInExpressions
186+
### `noAssignmentInExpressions`
187+
**type:** object
188+
189+
**description:** Assignment expressions must be their own statements. Assignment should not be used in an expression context that expects a `Void` value. For example, assigning a variable within a `return` statement existing a `Void` function is prohibited.
190+
191+
- `allowedFunctions` _(strings array)_: A list of function names where assignments are allowed to be embedded in expressions that are passed as parameters to that function.
192+
193+
**default:** `{ "allowedFunctions" : ["XCTAssertNoThrow"] }`
158194

159195
---
160196

@@ -167,7 +203,51 @@ top-level keys and values:
167203

168204
---
169205

170-
### FIXME: reflowMultilineStringLiterals
206+
### `reflowMultilineStringLiterals`
207+
**type:** `string`
208+
209+
**description:** Determines how multiline string literals should reflow when formatted.
210+
211+
- `never`: Never reflow multiline string literals.
212+
- `onlyLinesOverLength`: Reflow lines in string literal that exceed the maximum line length.
213+
For example with a line length of 10:
214+
```swift
215+
"""
216+
an escape\
217+
line break
218+
a hard line break
219+
"""
220+
```
221+
will be formatted as:
222+
```swift
223+
"""
224+
an esacpe\
225+
line break
226+
a hard \
227+
line break
228+
"""
229+
```
230+
- `always`: Always reflow multiline string literals, this will ignore existing escaped newlines in the literal and reflow each line. Hard linebreaks are still respected.
231+
For example, with a line length of 10:
232+
```swift
233+
"""
234+
one \
235+
word \
236+
a line.
237+
this is too long.
238+
"""
239+
```
240+
will be formatted as:
241+
```swift
242+
"""
243+
one word \
244+
a line.
245+
this is \
246+
too long.
247+
"""
248+
```
249+
250+
**default:** `"never"`
171251

172252
---
173253

0 commit comments

Comments
 (0)