Skip to content

Commit 7fb972a

Browse files
committed
Clean up
1 parent 57aadef commit 7fb972a

File tree

1 file changed

+21
-29
lines changed

1 file changed

+21
-29
lines changed

README.md

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,8 @@ _You can enable the following settings in Xcode by running [this script](resourc
156156
let myFleet = SpaceFleet()
157157
```
158158

159-
</details>
160-
161159
_Exception: You may prefix a private property with an underscore if it is backing an identically-named property or method with a higher access level._
162160

163-
<details>
164-
165161
#### Why?
166162

167163
There are specific scenarios where a backing property or method that is prefixed with an underscore could be easier to read than using a more descriptive name.
@@ -552,7 +548,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
552548

553549
</details>
554550

555-
- <a id='trailing-commas'></a>(<a href='#trailing-commas'>link</a>) \*_Add a trailing comma after the last element of multi-line, multi-element comma-separated lists._ This includes arrays, dictionaries, function declarations, function calls, etc. Don't include a trailing comma if the list spans only a single line, or contains only a single element.
551+
- <a id='trailing-commas'></a>(<a href='#trailing-commas'>link</a>) **Add a trailing comma after the last element of multi-line, multi-element comma-separated lists.** This includes arrays, dictionaries, function declarations, function calls, etc. Don't include a trailing comma if the list spans only a single line, or contains only a single element.
556552

557553
<details>
558554

@@ -1105,7 +1101,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
11051101

11061102
</details>
11071103

1108-
- <a id='long-typealias'></a>(<a href='#long-typealias'>link</a>) [Long](https://github.com/airbnb/swift#column-width) type aliases of protocol compositions should wrap before the `=` and before each individual `&`.
1104+
- <a id='long-typealias'></a>(<a href='#long-typealias'>link</a>) **[Long](#column-width) type aliases of protocol compositions should wrap before the `=` and before each individual `&`.**
11091105

11101106
<details>
11111107

@@ -1167,7 +1163,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
11671163

11681164
</details>
11691165

1170-
- <a id='prefer-if-let-shorthand'></a>(<a href='#prefer-if-let-shorthand'>link</a>) Omit the right-hand side of the expression when unwrapping an optional property to a non-optional property with the same name.
1166+
- <a id='prefer-if-let-shorthand'></a>(<a href='#prefer-if-let-shorthand'>link</a>) **Omit the right-hand side of the expression when unwrapping an optional property to a non-optional property with the same name.**
11711167

11721168
<details>
11731169

@@ -1261,15 +1257,15 @@ _You can enable the following settings in Xcode by running [this script](resourc
12611257

12621258
</details>
12631259

1264-
- <a id='multi-line-conditions'></a>(<a href='#multi-line-conditions'>link</a>) **Multi-line conditional statements should break after the leading keyword.** Indent each individual statement by [2 spaces](https://github.com/airbnb/swift#spaces-over-tabs).
1260+
- <a id='multi-line-conditions'></a>(<a href='#multi-line-conditions'>link</a>) **Multi-line conditional statements should break after the leading keyword.** Indent each individual statement by [2 spaces](#spaces-over-tabs).
12651261

12661262
<details>
12671263

12681264
[![SwiftFormat: wrapArguments](https://img.shields.io/badge/SwiftFormat-wrapArguments-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#wrapArguments)
12691265

12701266
#### Why?
12711267

1272-
Breaking after the leading keyword resets indentation to the standard [2-space grid](https://github.com/airbnb/swift#spaces-over-tabs),
1268+
Breaking after the leading keyword resets indentation to the standard [2-space grid](#spaces-over-tabs),
12731269
which helps avoid fighting Xcode's <kbd>^</kbd> + <kbd>I</kbd> indentation behavior.
12741270

12751271
```swift
@@ -1780,7 +1776,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
17801776

17811777
</details>
17821778

1783-
- <a id='single-line-expression-braces'></a>(<a href='#single-line-expression-braces'>link</a>) The opening brace following a single-line expression should be on the same line as the rest of the statement.
1779+
- <a id='single-line-expression-braces'></a>(<a href='#single-line-expression-braces'>link</a>) **The opening brace following a single-line expression should be on the same line as the rest of the statement.**
17841780

17851781
<details>
17861782

@@ -1817,7 +1813,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
18171813

18181814
</details>
18191815

1820-
- <a id='multi-line-expression-braces'></a>(<a href='#multi-line-expression-braces'>link</a>) The opening brace following a multi-line expression should wrap to a new line.
1816+
- <a id='multi-line-expression-braces'></a>(<a href='#multi-line-expression-braces'>link</a>) **The opening brace following a multi-line expression should wrap to a new line.**
18211817

18221818
<details>
18231819

@@ -1876,7 +1872,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
18761872

18771873
</details>
18781874

1879-
- <a id='no-spaces-around-function-parens'></a>(<a href='#no-spaces-around-parens'>link</a>) For function calls and declarations, there should be no spaces before or inside the parentheses of the argument list.
1875+
- <a id='no-spaces-around-function-parens'></a>(<a href='#no-spaces-around-parens'>link</a>) **For function calls and declarations, there should be no spaces before or inside the parentheses of the argument list.**
18801876

18811877
<details>
18821878

@@ -2100,7 +2096,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
21002096

21012097
</details>
21022098

2103-
- <a id='whitespace-around-comment-delimiters'></a>(<a href='#whitespace-around-comment-delimiters'>link</a>) Include spaces or newlines before and after comment delimiters (`//`, `///`, `/*`, and `*/`)
2099+
- <a id='whitespace-around-comment-delimiters'></a>(<a href='#whitespace-around-comment-delimiters'>link</a>) **Include spaces or newlines before and after comment delimiters** (`//`, `///`, `/*`, and `*/`)
21042100

21052101
<details>
21062102

@@ -2132,7 +2128,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
21322128

21332129
</details>
21342130

2135-
- <a id='space-in-empty-braces'></a>(<a href='#space-in-empty-braces'>link</a>) Include a single space in an empty set of braces (`{ }`).
2131+
- <a id='space-in-empty-braces'></a>(<a href='#space-in-empty-braces'>link</a>) **Include a single space in an empty set of braces** (`{ }`).
21362132

21372133
<details>
21382134

@@ -2265,7 +2261,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
22652261

22662262
</details>
22672263

2268-
- <a id='long-function-declaration'></a>(<a href='#long-function-declaration'>link</a>) **Separate [long](https://github.com/airbnb/swift#column-width) function declarations with line breaks before each argument label, and before the closing parenthesis (`)`).**
2264+
- <a id='long-function-declaration'></a>(<a href='#long-function-declaration'>link</a>) **Separate [long](#column-width) function declarations with line breaks before each argument label, and before the closing parenthesis (`)`).**
22692265

22702266
<details>
22712267

@@ -2342,7 +2338,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
23422338

23432339
</details>
23442340

2345-
- <a id='long-function-invocation'></a>(<a href='#long-function-invocation'>link</a>) **[Long](https://github.com/airbnb/swift#column-width) function calls should also break on each argument.** Put the closing parenthesis on its own line.
2341+
- <a id='long-function-invocation'></a>(<a href='#long-function-invocation'>link</a>) **[Long](#column-width) function calls should also break on each argument.** Put the closing parenthesis on its own line.
23462342

23472343
<details>
23482344

@@ -2785,7 +2781,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
27852781

27862782
</details>
27872783

2788-
- <a id='long-ternary-operator-expressions'></a>(<a href='#long-ternary-operator-expressions'>link</a>) **[Long](https://github.com/airbnb/swift#column-width) ternary operator expressions should wrap before the `?` and before the `:`**, putting each conditional branch on a separate line.
2784+
- <a id='long-ternary-operator-expressions'></a>(<a href='#long-ternary-operator-expressions'>link</a>) **[Long](#column-width) ternary operator expressions should wrap before the `?` and before the `:`**, putting each conditional branch on a separate line.
27892785

27902786
<details>
27912787

@@ -2812,7 +2808,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
28122808

28132809
</details>
28142810

2815-
- <a id='use-commas-in-and-conditions'></a>(<a href='#use-commas-in-and-conditions'>link</a>) In conditional statements (`if`, `guard`, `while`), separate boolean conditions using commas (`,`) instead of `&&` operators.
2811+
- <a id='use-commas-in-and-conditions'></a>(<a href='#use-commas-in-and-conditions'>link</a>) **In conditional statements (`if`, `guard`, `while`), separate boolean conditions using commas (`,`) instead of `&&` operators.**
28162812

28172813
<details>
28182814

@@ -2848,7 +2844,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
28482844

28492845
</details>
28502846

2851-
- <a id='prefer-bound-generic-extension-shorthand'></a>(<a href='#prefer-bound-generic-extension-shorthand'>link</a>) When extending bound generic types, prefer using generic bracket syntax (`extension Collection<Planet>`), or sugared syntax for applicable standard library types (`extension [Planet]`) instead of generic type constraints.
2847+
- <a id='prefer-bound-generic-extension-shorthand'></a>(<a href='#prefer-bound-generic-extension-shorthand'>link</a>) **When extending bound generic types, prefer using generic bracket syntax (`extension Collection<Planet>`), or sugared syntax for applicable standard library types (`extension [Planet]`) instead of generic type constraints.**
28522848

28532849
<details>
28542850

@@ -3207,13 +3203,13 @@ _You can enable the following settings in Xcode by running [this script](resourc
32073203
</details>
32083204

32093205
- <a id='namespace-using-enums'></a>(<a href='#namespace-using-enums'>link</a>) **Use caseless `enum`s for organizing `public` or `internal` constants and functions into namespaces.**
3210-
- Avoid creating non-namespaced global constants and functions.
3211-
- Feel free to nest namespaces where it adds clarity.
3212-
- `private` globals are permitted, since they are scoped to a single file and do not pollute the global namespace. Consider placing private globals in an `enum` namespace to match the guidelines for other declaration types.
32133206

32143207
<details>
32153208

32163209
[![SwiftFormat: enumNamespaces](https://img.shields.io/badge/SwiftFormat-enumNamespaces-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#enumNamespaces)
3210+
- Avoid creating non-namespaced global constants and functions.
3211+
- Feel free to nest namespaces where it adds clarity.
3212+
- `private` globals are permitted, since they are scoped to a single file and do not pollute the global namespace. Consider placing private globals in an `enum` namespace to match the guidelines for other declaration types.
32173213

32183214
#### Why?
32193215

@@ -3587,7 +3583,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
35873583

35883584
</details>
35893585

3590-
- <a id='switch-avoid-default'></a>(<a href='#switch-avoid-default'>link</a>) When switching over an enum, generally prefer enumerating all cases rather than using the `default` case.
3586+
- <a id='switch-avoid-default'></a>(<a href='#switch-avoid-default'>link</a>) **When switching over an enum, generally prefer enumerating all cases rather than using the `default` case.**
35913587

35923588
<details>
35933589

@@ -4350,7 +4346,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
43504346

43514347
</details>
43524348

4353-
- <a id='url-macro'></a>(<a href='#url-macro'>link</a>) **If available in your project, prefer using a `#URL(_:)` macro instead of force-unwrapping `URL(string:)!` initializer`**.
4349+
- <a id='url-macro'></a>(<a href='#url-macro'>link</a>) **If available in your project, prefer using a `#URL(_:)` macro instead of force-unwrapping `URL(string:)!` initializer**.
43544350

43554351
<details>
43564352

@@ -4374,7 +4370,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
43744370

43754371
## File Organization
43764372

4377-
- <a id='alphabetize-and-deduplicate-imports'></a>(<a href='#alphabetize-and-deduplicate-imports'>link</a>) **Alphabetize and deduplicate module imports within a file. Place all imports at the top of the file below the header comments. Do not add additional line breaks between import statements. Add a single empty line before the first import and after the last import.**
4373+
- <a id='alphabetize-and-deduplicate-imports'></a>(<a href='#alphabetize-and-deduplicate-imports'>link</a>) **Alphabetize and deduplicate module imports within a file.** Place all imports at the top of the file below the header comments. Do not add additional line breaks between import statements. Add a single empty line before the first import and after the last import.
43784374

43794375
<details>
43804376

@@ -4407,12 +4403,8 @@ _You can enable the following settings in Xcode by running [this script](resourc
44074403
import Foundation
44084404
```
44094405

4410-
</details>
4411-
44124406
_Exception: `@testable import` should be grouped after the regular import and separated by an empty line._
44134407

4414-
<details>
4415-
44164408
```swift
44174409
// WRONG
44184410

0 commit comments

Comments
 (0)