Skip to content

Commit

Permalink
Fix some typos (#5683)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimplyDanny authored Jul 20, 2024
1 parent 238415b commit 9f8a3f5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ struct DiscardedNotificationCenterObserverRule: OptInRule {
obs.append(nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }))
"""),
Example("""
func foo(_ notif: Any) {
obs.append(notif)
func foo(_ notify: Any) {
obs.append(notify)
}
foo(nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }))
"""),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ struct OpeningBraceRuleExamples {
let bar: String? = "bar"
if
let foooo = foo,
let barrr = bar
let foo = foo,
let bar = bar
↓{
print(foooo + barrr)
print(foo + bar)
}
}
"""),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ open class ViolationsSyntaxRewriter<Configuration: RuleConfiguration>: SyntaxRew
/// Positions in a source file where corrections were applied.
public var correctionPositions = [AbsolutePosition]()

/// Initilizer for a ``ViolationsSyntaxRewriter``.
/// Initializer for a ``ViolationsSyntaxRewriter``.
///
/// - Parameters:
/// - configuration: Configuration of a rule.
Expand Down
14 changes: 7 additions & 7 deletions Tests/SwiftLintTestHelpers/TestHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public func violations(_ example: Example,

let file = SwiftLintFile.testFile(withContents: stringStrippingMarkers.code, persistToDisk: true)
let storage = RuleStorage()
let collecter = Linter(file: file, configuration: config, compilerArguments: file.makeCompilerArguments())
let linter = collecter.collect(into: storage)
let collector = Linter(file: file, configuration: config, compilerArguments: file.makeCompilerArguments())
let linter = collector.collect(into: storage)
return linter.styleViolations(using: storage).withoutFiles()
}

Expand Down Expand Up @@ -212,8 +212,8 @@ private extension Configuration {
let includeCompilerArguments = self.rules.contains(where: { $0 is any AnalyzerRule })
let compilerArguments = includeCompilerArguments ? file.makeCompilerArguments() : []
let storage = RuleStorage()
let collecter = Linter(file: file, configuration: self, compilerArguments: compilerArguments)
let linter = collecter.collect(into: storage)
let collector = Linter(file: file, configuration: self, compilerArguments: compilerArguments)
let linter = collector.collect(into: storage)
let corrections = linter.correct(using: storage).sorted { $0.location < $1.location }
if expectedLocations.isEmpty {
XCTAssertEqual(
Expand Down Expand Up @@ -420,14 +420,14 @@ public extension XCTestCase {
.map { $0.with(code: command + $0.code) }

for trigger in disabledTriggers {
let violationsPartionedByType = makeViolations(trigger)
let violationsPartitionedByType = makeViolations(trigger)
.partitioned { $0.ruleIdentifier == SuperfluousDisableCommandRule.description.identifier }

XCTAssert(violationsPartionedByType.first.isEmpty,
XCTAssert(violationsPartitionedByType.first.isEmpty,
"Violation(s) still triggered although rule was disabled",
file: trigger.file,
line: trigger.line)
XCTAssert(violationsPartionedByType.second.isEmpty,
XCTAssert(violationsPartitionedByType.second.isEmpty,
"Disable command was superfluous since no violations(s) triggered",
file: trigger.file,
line: trigger.line)
Expand Down

0 comments on commit 9f8a3f5

Please sign in to comment.