Skip to content

Commit 9e8449d

Browse files
authored
Merge pull request #2544 from ahoppen/ahoppen/120-columns
Change swift-format configuration to 120 columns
2 parents 047e681 + 4fae6c4 commit 9e8449d

File tree

182 files changed

+3603
-933
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+3603
-933
lines changed

.swift-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": 1,
3-
"lineLength": 160,
3+
"lineLength": 120,
44
"indentation": {
55
"spaces": 2
66
},

CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,11 @@ public let ATTRIBUTE_NODES: [Node] = [
180180
Child(
181181
name: "availabilityArguments",
182182
deprecatedName: "availabilityList",
183-
kind: .collection(kind: .availabilityArgumentList, collectionElementName: "AvailabilityArgument", deprecatedCollectionElementName: "Availability")
183+
kind: .collection(
184+
kind: .availabilityArgumentList,
185+
collectionElementName: "AvailabilityArgument",
186+
deprecatedCollectionElementName: "Availability"
187+
)
184188
),
185189
Child(
186190
name: "semicolon",
@@ -236,7 +240,11 @@ public let ATTRIBUTE_NODES: [Node] = [
236240
Child(
237241
name: "platforms",
238242
deprecatedName: "versionList",
239-
kind: .collection(kind: .platformVersionItemList, collectionElementName: "Platform", deprecatedCollectionElementName: "Availability"),
243+
kind: .collection(
244+
kind: .platformVersionItemList,
245+
collectionElementName: "Platform",
246+
deprecatedCollectionElementName: "Availability"
247+
),
240248
documentation: "The list of OS versions in which the declaration became ABI stable."
241249
),
242250
]
@@ -357,7 +365,8 @@ public let ATTRIBUTE_NODES: [Node] = [
357365
kind: .differentiabilityArgument,
358366
base: .syntax,
359367
nameForDiagnostics: "differentiability argument",
360-
documentation: "A differentiability argument: either the \"self\" identifier, a function parameter name, or a function parameter index.",
368+
documentation:
369+
"A differentiability argument: either the \"self\" identifier, a function parameter name, or a function parameter index.",
361370
traits: [
362371
"WithTrailingComma"
363372
],
@@ -471,7 +480,8 @@ public let ATTRIBUTE_NODES: [Node] = [
471480
name: "genericWhereClause",
472481
deprecatedName: "whereClause",
473482
kind: .node(kind: .genericWhereClause),
474-
documentation: "A `where` clause that places additional constraints on generic parameters like `where T: Differentiable`.",
483+
documentation:
484+
"A `where` clause that places additional constraints on generic parameters like `where T: Differentiable`.",
475485
isOptional: true
476486
),
477487
]
@@ -588,7 +598,8 @@ public let ATTRIBUTE_NODES: [Node] = [
588598
kind: .implementsAttributeArguments,
589599
base: .syntax,
590600
nameForDiagnostics: "@_implements arguemnts",
591-
documentation: "The arguments for the `@_implements` attribute of the form `Type, methodName(arg1Label:arg2Label:)`",
601+
documentation:
602+
"The arguments for the `@_implements` attribute of the form `Type, methodName(arg1Label:arg2Label:)`",
592603
children: [
593604
Child(
594605
name: "type",
@@ -738,14 +749,18 @@ public let ATTRIBUTE_NODES: [Node] = [
738749
base: .syntaxCollection,
739750
nameForDiagnostics: "argument to '@_specialize",
740751
documentation: "A collection of arguments for the `@_specialize` attribute",
741-
elementChoices: [.labeledSpecializeArgument, .specializeAvailabilityArgument, .specializeTargetFunctionArgument, .genericWhereClause]
752+
elementChoices: [
753+
.labeledSpecializeArgument, .specializeAvailabilityArgument, .specializeTargetFunctionArgument,
754+
.genericWhereClause,
755+
]
742756
),
743757

744758
Node(
745759
kind: .specializeTargetFunctionArgument,
746760
base: .syntax,
747761
nameForDiagnostics: "attribute argument",
748-
documentation: "A labeled argument for the `@_specialize` attribute with a function decl value like `target: myFunc(_:)`",
762+
documentation:
763+
"A labeled argument for the `@_specialize` attribute with a function decl value like `target: myFunc(_:)`",
749764
traits: [
750765
"WithTrailingComma"
751766
],

CodeGeneration/Sources/SyntaxSupport/AvailabilityNodes.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public let AVAILABILITY_NODES: [Node] = [
1515
kind: .availabilityArgument,
1616
base: .syntax,
1717
nameForDiagnostics: "availability argument",
18-
documentation: "A single argument to an `@available` argument like `*`, `iOS 10.1`, or `message: \"This has been deprecated\"`.",
18+
documentation:
19+
"A single argument to an `@available` argument like `*`, `iOS 10.1`, or `message: \"This has been deprecated\"`.",
1920
traits: ["WithTrailingComma"],
2021
children: [
2122
Child(
@@ -54,7 +55,8 @@ public let AVAILABILITY_NODES: [Node] = [
5455
kind: .availabilityLabeledArgument,
5556
base: .syntax,
5657
nameForDiagnostics: "availability argument",
57-
documentation: "An argument to an `@available` attribute that consists of a label and a value, e.g. `message: \"This has been deprecated\"`.",
58+
documentation:
59+
"An argument to an `@available` attribute that consists of a label and a value, e.g. `message: \"This has been deprecated\"`.",
5860
children: [
5961
Child(
6062
name: "label",
@@ -102,7 +104,8 @@ public let AVAILABILITY_NODES: [Node] = [
102104
kind: .platformVersion,
103105
base: .syntax,
104106
nameForDiagnostics: "version restriction",
105-
documentation: "An argument to `@available` that restricts the availability on a certain platform to a version, e.g. `iOS 10` or `swift 3.4`.",
107+
documentation:
108+
"An argument to `@available` that restricts the availability on a certain platform to a version, e.g. `iOS 10` or `swift 3.4`.",
106109
children: [
107110
Child(
108111
name: "platform",
@@ -157,7 +160,8 @@ public let AVAILABILITY_NODES: [Node] = [
157160
kind: .versionTuple,
158161
base: .syntax,
159162
nameForDiagnostics: "version tuple",
160-
documentation: "A version number like `1.2.0`. Only the first version component is required. There might be an arbitrary number of following components.",
163+
documentation:
164+
"A version number like `1.2.0`. Only the first version component is required. There might be an arbitrary number of following components.",
161165
parserFunction: "parseVersionTuple",
162166
children: [
163167
Child(
@@ -168,7 +172,8 @@ public let AVAILABILITY_NODES: [Node] = [
168172
Child(
169173
name: "components",
170174
kind: .collection(kind: .versionComponentList, collectionElementName: "VersionComponent"),
171-
documentation: "Any version components that are not the major version . For example, for `1.2.0`, this will contain `.2.0`."
175+
documentation:
176+
"Any version components that are not the major version . For example, for `1.2.0`, this will contain `.2.0`."
172177
),
173178
]
174179
),

CodeGeneration/Sources/SyntaxSupport/Child.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ public enum ChildKind {
4141
/// The child always contains a node that matches one of the `choices`.
4242
case nodeChoices(choices: [Child])
4343
/// The child is a collection of `kind`.
44-
case collection(kind: SyntaxNodeKind, collectionElementName: String, defaultsToEmpty: Bool = false, deprecatedCollectionElementName: String? = nil)
44+
case collection(
45+
kind: SyntaxNodeKind,
46+
collectionElementName: String,
47+
defaultsToEmpty: Bool = false,
48+
deprecatedCollectionElementName: String? = nil
49+
)
4550
/// The child is a token that matches one of the given `choices`.
4651
/// If `requiresLeadingSpace` or `requiresTrailingSpace` is not `nil`, it
4752
/// overrides the default leading/trailing space behavior of the token.
@@ -259,7 +264,10 @@ public class Child {
259264
isOptional: Bool = false
260265
) {
261266
precondition(name.first?.isLowercase ?? true, "The first letter of a child’s name should be lowercase")
262-
precondition(deprecatedName?.first?.isLowercase ?? true, "The first letter of a child’s deprecatedName should be lowercase")
267+
precondition(
268+
deprecatedName?.first?.isLowercase ?? true,
269+
"The first letter of a child’s deprecatedName should be lowercase"
270+
)
263271
self.name = name
264272
self.deprecatedName = deprecatedName
265273
self.kind = kind

CodeGeneration/Sources/SyntaxSupport/CommonNodes.swift

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ public let COMMON_NODES: [Node] = [
191191
kind: .missingDecl,
192192
base: .decl,
193193
nameForDiagnostics: "declaration",
194-
documentation: "In case the source code is missing a declaration, this node stands in place of the missing declaration.",
194+
documentation:
195+
"In case the source code is missing a declaration, this node stands in place of the missing declaration.",
195196
traits: [
196197
"MissingNode",
197198
"WithAttributes",
@@ -201,12 +202,14 @@ public let COMMON_NODES: [Node] = [
201202
Child(
202203
name: "attributes",
203204
kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true),
204-
documentation: "If there were standalone attributes without a declaration to attach them to, the ``MissingDeclSyntax`` will contain these."
205+
documentation:
206+
"If there were standalone attributes without a declaration to attach them to, the ``MissingDeclSyntax`` will contain these."
205207
),
206208
Child(
207209
name: "modifiers",
208210
kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true),
209-
documentation: "If there were standalone modifiers without a declaration to attach them to, the ``MissingDeclSyntax`` will contain these."
211+
documentation:
212+
"If there were standalone modifiers without a declaration to attach them to, the ``MissingDeclSyntax`` will contain these."
210213
),
211214
Child(
212215
name: "placeholder",
@@ -224,7 +227,8 @@ public let COMMON_NODES: [Node] = [
224227
kind: .missingExpr,
225228
base: .expr,
226229
nameForDiagnostics: "expression",
227-
documentation: "In case the source code is missing an expression, this node stands in place of the missing expression.",
230+
documentation:
231+
"In case the source code is missing an expression, this node stands in place of the missing expression.",
228232
traits: [
229233
"MissingNode"
230234
],
@@ -266,7 +270,8 @@ public let COMMON_NODES: [Node] = [
266270
kind: .missingStmt,
267271
base: .stmt,
268272
nameForDiagnostics: "statement",
269-
documentation: "In case the source code is missing a statement, this node stands in place of the missing statement.",
273+
documentation:
274+
"In case the source code is missing a statement, this node stands in place of the missing statement.",
270275
traits: [
271276
"MissingNode"
272277
],
@@ -372,7 +377,8 @@ public let COMMON_NODES: [Node] = [
372377
kind: .unexpectedNodes,
373378
base: .syntaxCollection,
374379
nameForDiagnostics: nil,
375-
documentation: "A collection of syntax nodes that occurred in the source code but could not be used to form a valid syntax tree.",
380+
documentation:
381+
"A collection of syntax nodes that occurred in the source code but could not be used to form a valid syntax tree.",
376382
elementChoices: [.syntax]
377383
),
378384

0 commit comments

Comments
 (0)