This is a SwiftFormat Tuist - a plugin for Tuist to format Swift projects using SwiftFormat.
Install • Usage • Contributing
To set up as a Tuist plugin in your project simply follow the Tuist plugin install instructions using the latest version.
Add the plugin to Config.swift
.
import ProjectDescription
let config = Config(
plugins: [
.git(url: "https://github.com/lordcodes/swiftformat-tuist.git", tag: "[VERSION]")
]
)
Run SwiftFormat Tuist's tasks via Tuist.
USAGE: tuist swiftformat [<subcommand>]
DEFAULT SUBCOMMAND:
Run SwiftFormat in format mode.
SUBCOMMANDS:
format Run SwiftFormat in format mode.
lint Run SwiftFormat in lint mode.
help Print this help information.
version Print SwiftFormat Tuist version.
See 'tuist swiftformat <subcommand> --help' for detailed help.
The plugin is a lightweight wrapper around the SwiftFormat command-line tool. If no files are specified to lint, it will pass the current directory as the first argument to SwiftFormat.
For example, a common set up would be:
- Create a
.swiftformat
config file in the root of the project. - List all the files/directories to skip using
--excludes
. - From root run
tuist swiftformat
to format code. - From root run
tuist swiftformat lint
to check if code is formatted.
If you notice any bugs or have a new feature to suggest, please check out the contributing guide. If you want to make changes, please make sure to discuss anything big before putting in the effort of creating the PR.
To reach out, please contact @lordcodes on Twitter.