An Xcode plugin to enable/disable running SwiftLint, and customizable by shell script.
Many thanks to ExtraBuildPhase for the base code. This plugin just adds ability to enable/disable running the lint. If you don't want to run swiftLint with every build. Then, use this plugin.
- Xcode 7.1 or later
- SwiftLint for default shell script
- Alcatraz (Comming soon)
- Building the project with Xcode will install the plugin.
Restart Xcode after installing
- Enable SwiftLint from Product -> SwiftLint.
- Build the project.
- You can then Disable SwiftLint from Product -> SwiftLint, then build again.
# Change shell script
defaults write com.mohamede1945.SwiftLintPlugin shellScript -string '
if which swiftlint >/dev/null; then
swiftlint lint --use-script-input-files --config ~/.swiftlint.yml 2>/dev/null
fi
exit 0 # ignore result of swiftlint
'
# Changes will be applied after "Product > Clean⇧⌘K"
# Show environment variables in build log
defaults write com.mohamede1945.SwiftLintPlugin showEnvVarsInLog -bool true
# Run shell script not only on Xcode, but also xcodebuild.
defaults write com.mohamede1945.SwiftLintPlugin isNotLimitedToXcode -bool true
Mohamed Afifi, [email protected]
SwiftLintPlugin is available under the MIT license. See the LICENSE file for more info.