swiftlint¶
Run swift code validation using SwiftLint
swiftlint | |
---|---|
Supported platforms | ios, mac |
Author | @KrauseFx |
1 Example¶
swiftlint(
mode: :lint, # SwiftLint mode: :lint (default) or :autocorrect
path: "/path/to/lint", # Specify path to lint (optional)
output_file: "swiftlint.result.json", # The path of the output file (optional)
config_file: ".swiftlint-ci.yml", # The path of the configuration file (optional)
files: [# List of files to process (optional)
"AppDelegate.swift",
"path/to/project/Model.swift"
],
ignore_exit_status: true # Allow fastlane to continue even if SwiftLint returns a non-zero exit status
)
Parameters¶
Key | Description | Default |
---|---|---|
mode |
SwiftLint mode: :lint or :autocorrect | :lint |
path |
Specify path to lint | |
output_file |
Path to output SwiftLint result | |
config_file |
Custom configuration file of SwiftLint | |
strict |
Fail on warnings? (true/false) | false |
files |
List of files to process | |
ignore_exit_status |
Ignore the exit status of the SwiftLint command, so that serious violations don't fail the build (true/false) | false |
reporter |
Choose output reporter | |
quiet |
Don't print status logs like 'Linting |
false |
executable |
Path to the swiftlint executable on your machine |
* = default value is dependent on the user's system
To show the documentation in your terminal, run
fastlane action swiftlint