Skip to content

Commit bf17fa9

Browse files
dduangithub-actions[bot]
authored andcommitted
Rename variable name
1 parent f0ab30a commit bf17fa9

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

Sources/Critic/DocProblem.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ public struct DocProblem {
2929
case verticalAlignment(Int, String, Int) // Expected, name/keyword, line number
3030
case spaceAfterColon(String, String) // Keyword, actual
3131
case keywordCasingForParameter(String, String, String) // Actual, expected, name
32-
// TODO: it's also about spelling of the keywords
33-
case keywordCasing(String, String) // Actual, expected
32+
case keywordSpelling(String, String) // Actual, expected
3433
case descriptionShouldEndWithEmptyLine
3534
case sectionShouldEndWithEmptyLine(String) // keyword or parameter name
3635
case redundantKeyword(String) // keyword
@@ -64,7 +63,7 @@ public struct DocProblem {
6463
return "E009"
6564
case .spaceAfterColon:
6665
return "E010"
67-
case .keywordCasingForParameter, .keywordCasing:
66+
case .keywordCasingForParameter, .keywordSpelling:
6867
return "E011"
6968
case .descriptionShouldEndWithEmptyLine, .sectionShouldEndWithEmptyLine:
7069
return "E012"

Sources/Critic/Validating.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func findReturnsProblems(
122122

123123
if let keyword = returnsDoc.keyword?.text {
124124
if keyword != expectedKeyword {
125-
result.append((.init(lineNumber, column), .keywordCasing(keyword, expectedKeyword)))
125+
result.append((.init(lineNumber, column), .keywordSpelling(keyword, expectedKeyword)))
126126
}
127127

128128
column += keyword.count
@@ -206,7 +206,7 @@ func findThrowsProblems(
206206
let expectedKeyword = firstLetterUpper ? "Throws" : "throws"
207207
if let keyword = throwsDoc.keyword?.text {
208208
if keyword != expectedKeyword {
209-
result.append((.init(lineNumber, column), .keywordCasing(keyword, expectedKeyword)))
209+
result.append((.init(lineNumber, column), .keywordSpelling(keyword, expectedKeyword)))
210210
}
211211

212212
column += keyword.count
@@ -290,7 +290,7 @@ func findParameterProblems(fallback: RelativeLocation, _ line: Int, _ parameters
290290

291291
let expectedKeyword = firstLetterUpper ? "Parameters" : "parameters"
292292
if keyword.text != expectedKeyword {
293-
result.append((.init(lineNumber, column), .keywordCasing(keyword.text, expectedKeyword)))
293+
result.append((.init(lineNumber, column), .keywordSpelling(keyword.text, expectedKeyword)))
294294
}
295295

296296
column += keyword.text.count

Sources/Informant/PlainTextFormatter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private extension DocProblem.Detail {
3434
return "For `\(keyword)`, there should be exactly 1 space after `:`, found \(actualWhitespace(actual))"
3535
case .keywordCasingForParameter(let actual, let expected, let name):
3636
return "For `\(name)`, `\(expected)` is misspelled as `\(actual)`"
37-
case .keywordCasing(let actual, let expected):
37+
case .keywordSpelling(let actual, let expected):
3838
return "`\(expected)` is misspelled as `\(actual)`"
3939
case .descriptionShouldEndWithEmptyLine:
4040
return "Overall description should end with an empty line"

Sources/Informant/TtyTextFormatter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private extension DocProblem.Detail {
3535
return "For \(keyword, color: .green), there should be exactly 1 space after \(":", color: .green), found \(actualWhitespace(actual))"
3636
case .keywordCasingForParameter(let actual, let expected, let name):
3737
return "For \(name, color: .green), \(expected, color: .green) is misspelled as \(actual, color: .cyan)"
38-
case .keywordCasing(let actual, let expected):
38+
case .keywordSpelling(let actual, let expected):
3939
return "\(expected, color: .green) is misspelled as \(actual, color: .cyan)"
4040
case .descriptionShouldEndWithEmptyLine:
4141
return "Overall description should end with an empty line"

0 commit comments

Comments
 (0)