This project is a fastlane plugin. To get started with fastlane-plugin-swiftformat
, add it to your project by running:
gem 'fastlane-plugin-swiftformat'
Run swift code formatting using SwiftFormat with fastlane. An up-to-date list with all available rules can be found in Rules.md along with documentation for how they are used.
swiftformat(
executable: "Pods/SwiftFormat/CommandLineTool/swiftformat", # Path to the `swiftformat` executable on your machine (optional)
path: "path/to/format", # Path to format (optional)
rules: "indent,linebreaks", # Specify a whitelist of rules (optional)
disable: "redundantSelf,trailingClosures", # Specify rules to disable (optional)
enable: "isEmpty", # Specify rules to enable (optional)
swiftversion: "5.1" # Specify swift version (optional)
config: "path/to/configuration/.swiftformat" # Path to configuration file (optional)
header: '{file}\nCopyright (c) 2022 Foobar Industries' # Strip or replace the header comments in every file with the given template (optional)
dryrun: false, # Run in dry mode (without actually changing any files) (optional)
lint: true # Like `--dryrun`, but returns an error if formatting is needed (optional)
)
To run both the tests, and code style validation, run
rake
For any other issues and feedback about this plugin, please submit it to this repository.
For more information about how the fastlane
plugin system works, check out the Plugins documentation.
fastlane is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out fastlane.tools.