Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert generate pipeline plugin #424

Merged
merged 2 commits into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Documentation/Development.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Developing `swift-format`

## Keeping the Pipeline and Tests Updated

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 `SwiftFormatRules` 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.

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

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

If successful, this tool will update
`Sources/SwiftFormatConfiguration/RuleRegistry+Generated.swift` and
`Sources/SwiftFormat/Pipelines+Generated.swift`.

Likewise, you should keep the Linux XCTest manifests updated if you add or
remove any tests from `swift-format` by running the following command in your
terminal:

```shell
swift test --generate-linuxmain
```

## Command Line Options for Debugging

`swift-format` provides some hidden command line options to facilitate
Expand Down
20 changes: 5 additions & 15 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@ let package = Package(
.product(name: "SwiftSyntax", package: "swift-syntax"),
.product(name: "SwiftOperators", package: "swift-syntax"),
.product(name: "SwiftParser", package: "swift-syntax"),
],
plugins: ["generate-pipeline-plugin"]
]
),
.target(
name: "SwiftFormatConfiguration",
plugins: ["generate-pipeline-plugin"]
name: "SwiftFormatConfiguration"
),
.target(
name: "SwiftFormatCore",
Expand All @@ -65,8 +63,7 @@ let package = Package(
),
.target(
name: "SwiftFormatRules",
dependencies: ["SwiftFormatCore", "SwiftFormatConfiguration"],
plugins: ["generate-pipeline-plugin"]
dependencies: ["SwiftFormatCore", "SwiftFormatConfiguration"]
),
.target(
name: "SwiftFormatPrettyPrint",
Expand All @@ -93,22 +90,15 @@ let package = Package(
]
),

.plugin(
name: "generate-pipeline-plugin",
capability: .buildTool(),
dependencies: [
"generate-pipeline"
]
),
.executableTarget(
name: "generate-pipeline",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
"SwiftFormatCore",
"SwiftFormatRules",
.product(name: "SwiftSyntax", package: "swift-syntax"),
.product(name: "SwiftParser", package: "swift-syntax"),
]
),

.executableTarget(
name: "swift-format",
dependencies: [
Expand Down
73 changes: 0 additions & 73 deletions Plugins/generate-pipeline-plugin/GeneratePipelinePlugin.swift

This file was deleted.

Loading