Skip to content

Commit 7e8bd26

Browse files
authored
Spelling (#450)
* spelling: abbreviations * spelling: associated * spelling: behavior * spelling: calculated * spelling: capture * spelling: combobulator * spelling: container * spelling: documentation * spelling: formatted * spelling: indices * spelling: language * spelling: linted * spelling: objects * spelling: omitted * spelling: parameters * spelling: preexisting * spelling: remaining * spelling: returns * spelling: sentence * spelling: successfully * spelling: types Signed-off-by: Josh Soref <[email protected]>
1 parent 949c36d commit 7e8bd26

17 files changed

+38
-38
lines changed

Plugins/LintPlugin/plugin.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct LintPlugin {
2020
process.waitUntilExit()
2121

2222
if process.terminationReason == .exit && process.terminationStatus == 0 {
23-
print("Lintted the source code.")
23+
print("Linted the source code.")
2424
}
2525
else {
2626
let problem = "\(process.terminationReason):\(process.terminationStatus)"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ want to do.
6868
Once the build has finished, the `swift-format` executable will be located at
6969
`.build/release/swift-format`.
7070

71-
To test that the formatter was built succesfully and is compatible with your
71+
To test that the formatter was built successfully and is compatible with your
7272
Swift toolchain, you can also run the following command:
7373

7474
```sh

Sources/SwiftFormatPrettyPrint/PrettyPrint.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public class PrettyPrinter {
186186
outputBuffer.append(String(str))
187187
}
188188

189-
/// Writes newlines into the output stream, taking into account any pre-existing consecutive
189+
/// Writes newlines into the output stream, taking into account any preexisting consecutive
190190
/// newlines and the maximum allowed number of blank lines.
191191
///
192192
/// This function does some implicit collapsing of consecutive newlines to ensure that the
@@ -248,7 +248,7 @@ public class PrettyPrinter {
248248
/// Print out the provided token, and apply line-wrapping and indentation as needed.
249249
///
250250
/// This method takes a Token and it's length, and it keeps track of how much space is left on the
251-
/// current line it is printing on. If a token exceeds the remaning space, we break to a new line,
251+
/// current line it is printing on. If a token exceeds the remaining space, we break to a new line,
252252
/// and apply the appropriate level of indentation.
253253
///
254254
/// - Parameters:
@@ -569,7 +569,7 @@ public class PrettyPrinter {
569569
///
570570
/// - Returns: A String containing the formatted source code.
571571
public func prettyPrint() -> String {
572-
// Keep track of the indicies of the .open and .break token locations.
572+
// Keep track of the indices of the .open and .break token locations.
573573
var delimIndexStack = [Int]()
574574
// Keep a running total of the token lengths.
575575
var total = 0
@@ -584,7 +584,7 @@ public class PrettyPrinter {
584584
lengths.append(0)
585585

586586
// Open tokens have lengths equal to the total of the contents of its group. The value is
587-
// calcualted when close tokens are encountered.
587+
// calculated when close tokens are encountered.
588588
case .open:
589589
lengths.append(-total)
590590
delimIndexStack.append(i)

Sources/SwiftFormatPrettyPrint/Token.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ enum BreakKind: Equatable {
108108
case reset
109109

110110
/// A `contextual` break acts as either a `continue` break or maintains the existing level of
111-
/// indentation when it fires. The contextual breaking beahvior of a given contextual breaking
111+
/// indentation when it fires. The contextual breaking behavior of a given contextual breaking
112112
/// scope (i.e. inside a `contextualBreakingStart`/`contextualBreakingEnd` region) is set by the
113113
/// first child `contextualBreakingStart`/`contextualBreakingEnd` pair. When the first child is
114114
/// multiline the contextual breaks maintain indentation and they are continuations otherwise.

Sources/SwiftFormatRules/BeginDocumentationCommentWithOneLineSummary.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public final class BeginDocumentationCommentWithOneLineSummary: SyntaxLintRule {
162162
///
163163
/// This method is a fallback for platforms (like Linux, currently) where `String` does not
164164
/// support `NSLinguisticTagger` and its related APIs. It will fail to catch certain kinds of
165-
/// sentences (such as those containing abbrevations that are followed by a period, like "Dr.")
165+
/// sentences (such as those containing abbreviations that are followed by a period, like "Dr.")
166166
/// that the more advanced API can handle.
167167
private func nonLinguisticSentenceApproximations(in text: String) -> (
168168
sentences: [String], trailingText: Substring

Sources/SwiftFormatRules/DeclSyntaxProtocol+Comments.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ extension DeclSyntaxProtocol {
8787
var returnsDescription: String?
8888
var throwsDescription: String?
8989
// Takes the first sentence of the comment, and counts the number of lines it uses.
90-
let oneSenteceSummary = docComment.components(separatedBy: ".").first
91-
let numOfOneSentenceLines = oneSenteceSummary!.components(separatedBy: .newlines).count
90+
let oneSentenceSummary = docComment.components(separatedBy: ".").first
91+
let numOfOneSentenceLines = oneSentenceSummary!.components(separatedBy: .newlines).count
9292

9393
// Iterates to all the comments after the one sentence summary to find the parameter(s)
9494
// return tags and get their description.
@@ -114,7 +114,7 @@ extension DeclSyntaxProtocol {
114114
} else {
115115
switch currentSection {
116116
case .parameters:
117-
// After the paramters tag is found the following lines should be the parameters
117+
// After the parameters tag is found the following lines should be the parameters
118118
// description.
119119
guard let index = trimmedLine.firstIndex(of: ":") else { continue }
120120
let name = trimmedLine[..<index].trimmingCharacters(in: .init(charactersIn: " -:"))
@@ -138,7 +138,7 @@ extension DeclSyntaxProtocol {
138138
}
139139

140140
return ParseComment(
141-
oneSentenceSummary: oneSenteceSummary,
141+
oneSentenceSummary: oneSentenceSummary,
142142
commentParagraphs: commentParagraphs,
143143
parameters: params,
144144
throwsDescription: throwsDescription,

Sources/SwiftFormatRules/ModifierListSyntax+Convenience.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ extension ModifierListSyntax {
4646
return self
4747
}
4848

49-
/// Returns a foramatted declaration modifier token with the given name.
49+
/// Returns a formatted declaration modifier token with the given name.
5050
func createModifierToken(name: String) -> DeclModifierSyntax {
5151
let id = TokenSyntax.identifier(name, trailingTrivia: .spaces(1))
5252
let newModifier = DeclModifierSyntax(name: id, detail: nil)

Sources/SwiftFormatRules/OrderedImports.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public final class OrderedImports: SyntaxFormatRule {
188188
}
189189

190190
/// Sort the list of import lines lexicographically by the import path name. Any comments above an
191-
/// import lines should be assocaited with it, and move with the line during sorting. We also emit
191+
/// import lines should be associated with it, and move with the line during sorting. We also emit
192192
/// a linter error if an import line is discovered to be out of order.
193193
private func formatImports(_ imports: [Line]) -> [Line] {
194194
var linesWithLeadingComments: [(import: Line, comments: [Line])] = []
@@ -280,7 +280,7 @@ fileprivate func joinLines(_ inputLineLists: [Line]...) -> [Line] {
280280
}
281281

282282
/// This function transforms the statements in a CodeBlockItemListSyntax object into a list of Line
283-
/// obejcts. Blank lines and standalone comments are represented by their own Line object. Code with
283+
/// objects. Blank lines and standalone comments are represented by their own Line object. Code with
284284
/// a trailing comment are represented together in the same Line.
285285
fileprivate func generateLines(codeBlockItemList: CodeBlockItemListSyntax, context: Context)
286286
-> [Line]

Sources/SwiftFormatRules/UseShorthandTypeNames.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public final class UseShorthandTypeNames: SyntaxFormatRule {
197197
return (first, second)
198198
}
199199

200-
/// Retuns a `TypeSyntax` representing a shorthand array type (e.g., `[Foo]`) with the given
200+
/// Returns a `TypeSyntax` representing a shorthand array type (e.g., `[Foo]`) with the given
201201
/// element type and trivia.
202202
private func shorthandArrayType(
203203
element: TypeSyntax,

Sources/SwiftFormatRules/UseSynthesizedInitializer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ fileprivate enum AccessLevel {
201201
/// a struct that contains the given properties.
202202
///
203203
/// The rules for default memberwise initializer access levels are defined in The Swift
204-
/// Programming Languge:
204+
/// Programming Language:
205205
/// https://docs.swift.org/swift-book/LanguageGuide/AccessControl.html#ID21
206206
///
207207
/// - Parameter properties: The properties contained within the struct.

0 commit comments

Comments
 (0)