Visitar URL original
Swift Plugin - dprint - Code Formatter
// plugins

Swift

Swift code formatter (SwiftFormat wrapper).

Wrapper plugin that formats Swift code via bundled SwiftFormat.

Formats .swift files on macOS and Linux (x86_64 and aarch64).

This is a process plugin. Using this will cause the CLI to download, run, and communicate with a separate process that is not sandboxed (unlike Wasm plugins).

Install and Setup

In your project's directory with a dprint.json file, run:

dprint add drluckyspin/swift

This will update your config file to have an entry for the plugin. Then optionally specify a "swiftformat" property to add configuration:

{
  "swiftformat": {
    "swiftVersion": "5.9"
  },
  "plugins": [
    "https://plugins.dprint.dev/drluckyspin/swift-v0.1.0.json@faab1002bf499512dc2003198b844bf582cc6438d0dcab672be48478b5fcbafa"
  ]
}

Update to the latest release with dprint config update.

Configuration

See the plugin repository for configuration options and the JSON schema:

You can also keep a .swiftformat file in your project. The plugin passes --stdinpath so SwiftFormat discovers it automatically.

All plugins

Official Plugins

Community Plugins

Wrapper Plugins

Everything Else