Skip to content

Commit 615c2bc

Browse files
committed
Update generate-pipeline for the new module organization.
1 parent 65e19dd commit 615c2bc

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Sources/generate-pipeline/PipelineGenerator.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ final class PipelineGenerator: FileGenerator {
4040
4141
// This file is automatically generated with generate-pipeline. Do Not Edit!
4242
43-
import SwiftFormatCore
44-
import SwiftFormatRules
4543
import SwiftSyntax
4644
4745
/// A syntax visitor that delegates to individual rules for linting.

Sources/generate-pipeline/RuleCollector.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ final class RuleCollector {
135135
/// Ignore it if it doesn't have any; there's no point in putting no-op rules in the pipeline.
136136
/// Otherwise, return it (we don't need to look at the rest of the inheritances).
137137
guard !visitedNodes.isEmpty else { return nil }
138-
guard let ruleType = _typeByName("SwiftFormatRules.\(typeName)") as? Rule.Type else {
138+
guard let ruleType = _typeByName("SwiftFormat.\(typeName)") as? Rule.Type else {
139139
preconditionFailure("Failed to find type for rule named \(typeName)")
140140
}
141141
return DetectedRule(

Sources/generate-pipeline/main.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,20 @@ import SwiftSyntax
1616
let sourcesDirectory = URL(fileURLWithPath: #file)
1717
.deletingLastPathComponent()
1818
.deletingLastPathComponent()
19-
let rulesDirectory = sourcesDirectory.appendingPathComponent("SwiftFormatRules")
19+
let rulesDirectory = sourcesDirectory
20+
.appendingPathComponent("SwiftFormat")
21+
.appendingPathComponent("Rules")
2022
let pipelineFile = sourcesDirectory
2123
.appendingPathComponent("SwiftFormat")
24+
.appendingPathComponent("Core")
2225
.appendingPathComponent("Pipelines+Generated.swift")
2326
let ruleRegistryFile = sourcesDirectory
2427
.appendingPathComponent("SwiftFormatConfiguration")
2528
.appendingPathComponent("RuleRegistry+Generated.swift")
2629

2730
let ruleNameCacheFile = sourcesDirectory
28-
.appendingPathComponent("SwiftFormatRules")
31+
.appendingPathComponent("SwiftFormat")
32+
.appendingPathComponent("Core")
2933
.appendingPathComponent("RuleNameCache+Generated.swift")
3034

3135
var ruleCollector = RuleCollector()

0 commit comments

Comments
 (0)