Skip to content

Commit fdcf3c7

Browse files
authored
Merge pull request swiftlang#31 from allevato/dev-docs
Add development advice for keeping the pipeline and test manifest up-to-date.
2 parents b7f1253 + db685d6 commit fdcf3c7

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Documentation/Development.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Developing `swift-format`
22

3+
## Keeping the Pipeline and Tests Updated
4+
5+
Since Swift does not yet have a runtime reflection system, we use code
6+
generation to keep the linting/formatting pipeline up-to-date. If you add or
7+
remove any rules from the `SwiftFormatRules` module, or if you add or remove
8+
any `visit` methods from an existing rule in that module, you must run the
9+
`generate-pipeline` tool update the pipeline and configuration sources.
10+
11+
The easiest way to do this is to run the following command in your terminal:
12+
13+
```shell
14+
swift run generate-pipeline
15+
```
16+
17+
If successful, this tool will update
18+
`Sources/SwiftFormatConfiguration/RuleRegistry+Generated.swift` and
19+
`Sources/SwiftFormat/Pipelines+Generated.swift`.
20+
21+
Likewise, you should keep the Linux XCTest manifests updated if you add or
22+
remove any tests from `swift-format` by running the following command in your
23+
terminal:
24+
25+
```shell
26+
swift test --generate-linuxmain
27+
```
28+
329
## Command Line Options for Debugging
430

531
`swift-format` provides some hidden command line options to facilitate

0 commit comments

Comments
 (0)