Skip to content

Commit 28a4aaf

Browse files
committed
Bulk replace 3 -> 4 space indents.
Used a sed script to make the changes: % cat indent.sed /```swift$/,/```/ s/^ \([^ ]\)/ \1/g /```swift$/,/```/ s/^ \([^ ]\)/ \1/g /```swift$/,/```/ s/^ \([^ ]\)/ \1/g /```swift$/,/```/ s/^ \([^ ]\)/ \1/g /```swift$/,/```/ s/^ \([^ ]\)/ \1/g Replacing the longer indents first reduces false positives where three 3-space indents gets turned into three 4-space indents, which then looks like four 3-space indents and gets turned into four 4-space indents. However, still will need to do a manual pass to back out places where the 12 leading spaces were actually three 4s not four 3s. Applied it to every file: % for f in **.md do sed -f indent.sed $f > out.tmp rm $f mv out.tmp $f done Confirmed the only changes are spaces via 'git diff --ignore-space-change' which has no output.
1 parent 5e15c7b commit 28a4aaf

32 files changed

+1605
-1605
lines changed

Sources/TSPL/TSPL.docc/LanguageGuide/AccessControl.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -230,25 +230,25 @@ the default access level of the type's members will be internal.
230230
231231
```swift
232232
public class SomePublicClass { // explicitly public class
233-
public var somePublicProperty = 0 // explicitly public class member
234-
var someInternalProperty = 0 // implicitly internal class member
235-
fileprivate func someFilePrivateMethod() {} // explicitly file-private class member
236-
private func somePrivateMethod() {} // explicitly private class member
233+
public var somePublicProperty = 0 // explicitly public class member
234+
var someInternalProperty = 0 // implicitly internal class member
235+
fileprivate func someFilePrivateMethod() {} // explicitly file-private class member
236+
private func somePrivateMethod() {} // explicitly private class member
237237
}
238238

239239
class SomeInternalClass { // implicitly internal class
240-
var someInternalProperty = 0 // implicitly internal class member
241-
fileprivate func someFilePrivateMethod() {} // explicitly file-private class member
242-
private func somePrivateMethod() {} // explicitly private class member
240+
var someInternalProperty = 0 // implicitly internal class member
241+
fileprivate func someFilePrivateMethod() {} // explicitly file-private class member
242+
private func somePrivateMethod() {} // explicitly private class member
243243
}
244244

245245
fileprivate class SomeFilePrivateClass { // explicitly file-private class
246-
func someFilePrivateMethod() {} // implicitly file-private class member
247-
private func somePrivateMethod() {} // explicitly private class member
246+
func someFilePrivateMethod() {} // implicitly file-private class member
247+
private func somePrivateMethod() {} // explicitly private class member
248248
}
249249

250250
private class SomePrivateClass { // explicitly private class
251-
func somePrivateMethod() {} // implicitly private class member
251+
func somePrivateMethod() {} // implicitly private class member
252252
}
253253
```
254254

@@ -378,7 +378,7 @@ In fact, `someFunction()` won't compile as written below:
378378

379379
```swift
380380
func someFunction() -> (SomeInternalClass, SomePrivateClass) {
381-
// function implementation goes here
381+
// function implementation goes here
382382
}
383383
```
384384

@@ -410,7 +410,7 @@ for the function declaration to be valid:
410410

411411
```swift
412412
private func someFunction() -> (SomeInternalClass, SomePrivateClass) {
413-
// function implementation goes here
413+
// function implementation goes here
414414
}
415415
```
416416

@@ -445,10 +445,10 @@ therefore also have an access level of public:
445445

446446
```swift
447447
public enum CompassPoint {
448-
case north
449-
case south
450-
case east
451-
case west
448+
case north
449+
case south
450+
case east
451+
case west
452452
}
453453
```
454454

@@ -668,11 +668,11 @@ the original implementation of `someMethod()`:
668668

669669
```swift
670670
public class A {
671-
fileprivate func someMethod() {}
671+
fileprivate func someMethod() {}
672672
}
673673

674674
internal class B: A {
675-
override internal func someMethod() {}
675+
override internal func someMethod() {}
676676
}
677677
```
678678

@@ -700,13 +700,13 @@ or within the same module as the superclass for an internal member call):
700700

701701
```swift
702702
public class A {
703-
fileprivate func someMethod() {}
703+
fileprivate func someMethod() {}
704704
}
705705

706706
internal class B: A {
707-
override internal func someMethod() {
708-
super.someMethod()
709-
}
707+
override internal func someMethod() {
708+
super.someMethod()
709+
}
710710
}
711711
```
712712

@@ -811,12 +811,12 @@ which keeps track of the number of times a string property is modified:
811811

812812
```swift
813813
struct TrackedString {
814-
private(set) var numberOfEdits = 0
815-
var value: String = "" {
816-
didSet {
817-
numberOfEdits += 1
818-
}
819-
}
814+
private(set) var numberOfEdits = 0
815+
var value: String = "" {
816+
didSet {
817+
numberOfEdits += 1
818+
}
819+
}
820820
}
821821
```
822822

@@ -923,13 +923,13 @@ by combining the `public` and `private(set)` access-level modifiers:
923923

924924
```swift
925925
public struct TrackedString {
926-
public private(set) var numberOfEdits = 0
927-
public var value: String = "" {
928-
didSet {
929-
numberOfEdits += 1
930-
}
931-
}
932-
public init() {}
926+
public private(set) var numberOfEdits = 0
927+
public var value: String = "" {
928+
didSet {
929+
numberOfEdits += 1
930+
}
931+
}
932+
public init() {}
933933
}
934934
```
935935

Sources/TSPL/TSPL.docc/LanguageGuide/AdvancedOperators.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ to add together instances of the `Vector2D` structure:
715715

716716
```swift
717717
struct Vector2D {
718-
var x = 0.0, y = 0.0
718+
var x = 0.0, y = 0.0
719719
}
720720

721721
extension Vector2D {
@@ -989,7 +989,7 @@ You can now use this operator to check whether two `Vector2D` instances are equi
989989
let twoThree = Vector2D(x: 2.0, y: 3.0)
990990
let anotherTwoThree = Vector2D(x: 2.0, y: 3.0)
991991
if twoThree == anotherTwoThree {
992-
print("These two vectors are equivalent.")
992+
print("These two vectors are equivalent.")
993993
}
994994
// Prints "These two vectors are equivalent."
995995
```
@@ -1047,10 +1047,10 @@ you add a type method called `+++` to `Vector2D` as follows:
10471047

10481048
```swift
10491049
extension Vector2D {
1050-
static prefix func +++ (vector: inout Vector2D) -> Vector2D {
1051-
vector += vector
1052-
return vector
1053-
}
1050+
static prefix func +++ (vector: inout Vector2D) -> Vector2D {
1051+
vector += vector
1052+
return vector
1053+
}
10541054
}
10551055

10561056
var toBeDoubled = Vector2D(x: 1.0, y: 4.0)
@@ -1099,9 +1099,9 @@ which belongs to the precedence group `AdditionPrecedence`:
10991099
```swift
11001100
infix operator +-: AdditionPrecedence
11011101
extension Vector2D {
1102-
static func +- (left: Vector2D, right: Vector2D) -> Vector2D {
1103-
return Vector2D(x: left.x + right.x, y: left.y - right.y)
1104-
}
1102+
static func +- (left: Vector2D, right: Vector2D) -> Vector2D {
1103+
return Vector2D(x: left.x + right.x, y: left.y - right.y)
1104+
}
11051105
}
11061106
let firstVector = Vector2D(x: 1.0, y: 2.0)
11071107
let secondVector = Vector2D(x: 3.0, y: 4.0)

0 commit comments

Comments
 (0)