One of the most important parts of writing code is writing maintainable code. In a group setting especially, a style guide is very important. Lint tools help to enforce that (as well as checking for certain types of bugs). SwiftLint is a lint tool that is based on GitHub's Swift Style Guide.
Install it with Homebrew:
brew install swiftlint
There are 2 ways to use it, either A) run it from the shell, which will examine Swift code files in the current directory:
Or B) Add a
Run Script Phase:
if which swiftlint >/dev/null; then swiftlint else echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint" fi
As with all things Swift, it's a relatively new tool and it implements 31 rules as of writing.
There are more options such as using the
autocorrect option and more, described in the README.