The rules and macros described below are used to tidy Swift source files.
On this page:
swiftformat_format(name, config, output_suffix, srcs, swift_version)
Formats the Swift source files using nicklockwood/SwiftFormat
.
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
config | A swiftformat config file. | Label | optional | None |
output_suffix | The suffix to add to the output filename. | String | optional | "_formatted" |
srcs | The Swift source files to format. | List of labels | required | |
swift_version | The Swift version to be used by swiftformat . You probably want to add this to your config file instead of adding it here. |
String | optional | "" |
swiftformat_pkg(name, srcs, config)
Defines targets that will format, test and update the specified Swift sources.
NOTE: Any labels detected in the srcs
will be ignored.
PARAMETERS
swiftformat_register_prebuilt_toolchains(name, swiftformat_assets, register_toolchains)
Register and configure the toolchains to download pre-built SwiftFormat binaries.
PARAMETERS