File tree Expand file tree Collapse file tree 3 files changed +44
-18
lines changed Expand file tree Collapse file tree 3 files changed +44
-18
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ # Developing ` swift-format `
2
+
3
+ ## Check Out the Submodules
4
+
5
+ The ` CCommonMark ` target is a Git submodule that pulls the C code in
6
+ [ apple/swift-cmark] ( https://github.com/apple/swift-cmark ) into this
7
+ project.
8
+
9
+ After you clone this repository, remember to run the following commands
10
+ to make sure those sources are available to the compiler:
11
+
12
+ ``` shell
13
+ git submodule init
14
+ git submodule update
15
+ ```
16
+
17
+ ## Command Line Options for Debugging
18
+
19
+ ` swift-format ` provides some hidden command line options to facilitate
20
+ debugging the tool during development:
21
+
22
+ * ` --debug-disable-pretty-print ` : Disables the pretty-printing pass of the
23
+ formatter, causing only the syntax tree transformations in the first phase
24
+ pipeline to run.
25
+
26
+ * ` --debug-dump-token-stream ` : Dumps a human-readable indented structure
27
+ representing the pseudotoken stream constructed by the pretty printing
28
+ phase.
29
+
30
+ ## Support Scripts
31
+
32
+ The [ Scripts] ( ../Scripts ) directory contains a ` format-diff.sh ` script
33
+ that some developers may find useful. When invoked, it rebuilds
34
+ ` swift-format ` (if necessary to pick up any recent changes) and lets
35
+ you view a side-by-side ` diff ` with the original file on the left side
36
+ and the formatted output on the right side.
37
+
38
+ This script will use ` colordiff ` if it is installed on your ` PATH ` ;
39
+ otherwise, it will fall back to ` diff ` .
Original file line number Diff line number Diff line change @@ -36,10 +36,6 @@ as well as the following command line options:
36
36
* ` -i/--in-place ` : Overwrites the input files when formatting instead of
37
37
printing the results to standard output.
38
38
39
- The command line tool also provides some
40
- [ hidden debugging options] ( Documentation/Debugging.md ) for use when developing
41
- ` swift-format ` .
42
-
43
39
### Configuration
44
40
45
41
For any source file being checked or formatted, ` swift-format ` looks for a
@@ -81,3 +77,8 @@ Please see the documentation in the
81
77
[ ` SwiftFormatter ` ] ( Sources/SwiftFormat/SwiftFormatter.swift ) and
82
78
[ ` SwiftLinter ` ] ( Sources/SwiftFormat/SwiftLinter.swift ) classes for more
83
79
information about their usage.
80
+
81
+ ## Development
82
+
83
+ If you are interested in developing ` swift-format ` , there is additional
84
+ documentation about that [ here] ( Documentation/Development.md ) .
You can’t perform that action at this time.
0 commit comments