Skip to content

Commit

Permalink
Rename generate-pipeline to generate-swift-format.
Browse files Browse the repository at this point in the history
The name referring to just the pipeline is somewhat outdated now; it
generates a lot of other stuff now too. So give it a more appropriate
name indicating that it generates all the swift-format things.
  • Loading branch information
allevato committed Sep 21, 2023
1 parent 0e5e7b9 commit 7e4c06a
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Documentation/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Since Swift does not yet have a runtime reflection system, we use code
generation to keep the linting/formatting pipeline up-to-date. If you add or
remove any rules from the `SwiftFormat` module, or if you add or remove
any `visit` methods from an existing rule in that module, you must run the
`generate-pipeline` tool update the pipeline and configuration sources.
`generate-swift-format` tool update the pipeline and configuration sources.

The easiest way to do this is to run the following command in your terminal:

```shell
swift run generate-pipeline
swift run generate-swift-format
```

If successful, this tool will update the files `Pipelines+Generated.swift`,
Expand Down
5 changes: 2 additions & 3 deletions Documentation/RuleDocumentation.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<!-- This file is autogenerated with `generate-pipeline` utility of
`swift-format`. DO NOT EDIT MANUALLY! -->
<!-- This file is automatically generated with generate-swift-format. Do not edit! -->

# `swift-format` Lint and Format Rules

Use the rules below in the `rules` block of your `.swift-format`
configuration file, as described in
[Configuration](Configuration.md). All of these rules can be
[Configuration](Documentation/Configuration.md). All of these rules can be
applied in the linter, but only some of them can format your source code
automatically.

Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ let package = Package(
path: "Plugins/LintPlugin"
),
.executableTarget(
name: "generate-pipeline",
name: "generate-swift-format",
dependencies: [
"SwiftFormat",
.product(name: "SwiftSyntax", package: "swift-syntax"),
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftFormat/API/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public struct Configuration: Codable, Equatable {
/// A dictionary containing the default enabled/disabled states of rules, keyed by the rules'
/// names.
///
/// This value is generated by `generate-pipeline` based on the `isOptIn` value of each rule.
/// This value is generated by `generate-swift-format` based on the `isOptIn` value of each rule.
public static let defaultRuleEnablements: [String: Bool] = RuleRegistry.rules

/// The version of this configuration.
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftFormat/Core/Context.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public final class Context {
ruleNameCache[ObjectIdentifier(rule)] != nil,
"""
Missing cached rule name for '\(rule)'! \
Ensure `generate-pipelines` has been run and `ruleNameCache` was injected.
Ensure `generate-swift-format` has been run and `ruleNameCache` was injected.
""")

let ruleName = ruleNameCache[ObjectIdentifier(rule)] ?? R.ruleName
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftFormat/Core/Pipelines+Generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//
//===----------------------------------------------------------------------===//

// This file is automatically generated with generate-pipeline. Do Not Edit!
// This file is automatically generated with generate-swift-format. Do not edit!

import SwiftSyntax

Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftFormat/Core/RuleNameCache+Generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//
//===----------------------------------------------------------------------===//

// This file is automatically generated with generate-pipeline. Do Not Edit!
// This file is automatically generated with generate-swift-format. Do not edit!

/// By default, the `Rule.ruleName` should be the name of the implementing rule type.
@_spi(Testing)
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftFormat/Core/RuleRegistry+Generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//
//===----------------------------------------------------------------------===//

// This file is automatically generated with generate-pipeline. Do Not Edit!
// This file is automatically generated with generate-swift-format. Do not edit!

@_spi(Internal) public enum RuleRegistry {
public static let rules: [String: Bool] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ final class PipelineGenerator: FileGenerator {
//
//===----------------------------------------------------------------------===//
// This file is automatically generated with generate-pipeline. Do Not Edit!
// This file is automatically generated with generate-swift-format. Do not edit!
import SwiftSyntax
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ final class RuleDocumentationGenerator: FileGenerator {
func write(into handle: FileHandle) throws {
handle.write(
"""
<!-- This file is autogenerated with `generate-pipeline` utility of
`swift-format`. DO NOT EDIT MANUALLY! -->
<!-- This file is automatically generated with generate-swift-format. Do not edit! -->
# `swift-format` Lint and Format Rules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ final class RuleNameCacheGenerator: FileGenerator {
//
//===----------------------------------------------------------------------===//
// This file is automatically generated with generate-pipeline. Do Not Edit!
// This file is automatically generated with generate-swift-format. Do not edit!
/// By default, the `Rule.ruleName` should be the name of the implementing rule type.
@_spi(Testing)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ final class RuleRegistryGenerator: FileGenerator {
//
//===----------------------------------------------------------------------===//
// This file is automatically generated with generate-pipeline. Do Not Edit!
// This file is automatically generated with generate-swift-format. Do not edit!
@_spi(Internal) public enum RuleRegistry {
public static let rules: [String: Bool] = [
Expand Down
File renamed without changes.

0 comments on commit 7e4c06a

Please sign in to comment.