Skip to content

Commit aa32253

Browse files
committed
Generate rule docs automatically
- This commit adds a `generate-pipeline` generator `RuleDocumentationGenerator` that extracts each rule DocC comment, and writes it into `Documentation/RuleDocumentation.md`. - In `Documentation/Configuration.md`, I've added a paragraph on rules configuration that links to the new auto-generated docs file, and also tells users that they can run `swift-format dump-configuration` to check out the list of available rules.
1 parent 0ebb3c8 commit aa32253

File tree

5 files changed

+588
-1
lines changed

5 files changed

+588
-1
lines changed

Documentation/Configuration.md

+12
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ An example `.swift-format` configuration file is shown below.
103103
}
104104
```
105105

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

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

0 commit comments

Comments
 (0)