Skip to content

Commit f4103e3

Browse files
authored
Merge pull request #621 from allevato/5.9-cherrypicks
Cherrypick everything since release/5.9 was cut.
2 parents 4f559a0 + 4a389b0 commit f4103e3

File tree

265 files changed

+11383
-7757
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

265 files changed

+11383
-7757
lines changed

Documentation/Configuration.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ top-level keys and values:
8282
* `spacesAroundRangeFormationOperators` _(boolean)_: Determines whether whitespace should be forced
8383
before and after the range formation operators `...` and `..<`.
8484

85+
* `multiElementCollectionTrailingCommas` _(boolean)_: Determines whether multi-element collection literals should have trailing commas.
86+
Defaults to `true`.
87+
8588
> TODO: Add support for enabling/disabling specific syntax transformations in
8689
> the pipeline.
8790
@@ -103,6 +106,18 @@ An example `.swift-format` configuration file is shown below.
103106
}
104107
```
105108

109+
## Linter and Formatter Rules Configuration
110+
111+
In the `rules` block of `.swift-format`, you can specify which rules to apply
112+
when linting and formatting your project. Read the
113+
[rules documentation](Documentation/RuleDocumentation.md) to see the list of all
114+
supported linter and formatter rules, and their overview.
115+
116+
You can also run this command to see the list of rules in the default
117+
`swift-format` configuration:
118+
119+
$ swift-format dump-configuration
120+
106121
## API Configuration
107122

108123
The `SwiftConfiguration` module contains a `Configuration` type that is

Documentation/Development.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Since Swift does not yet have a runtime reflection system, we use code
66
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
7+
remove any rules from the `SwiftFormat` module, or if you add or remove
88
any `visit` methods from an existing rule in that module, you must run the
99
`generate-pipeline` tool update the pipeline and configuration sources.
1010

@@ -14,17 +14,9 @@ The easiest way to do this is to run the following command in your terminal:
1414
swift run generate-pipeline
1515
```
1616

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-
```
17+
If successful, this tool will update the files `Pipelines+Generated.swift`,
18+
`RuleNameCache+Generated.swift`, and `RuleRegistry+Generated.swift` in
19+
the `Sources/SwiftFormat/Core` directory.
2820

2921
## Command Line Options for Debugging
3022

0 commit comments

Comments
 (0)