Qvik's official SwiftLint rule set.
SwiftLint is a tool for enforcing Swift language coding style. The purpose of including it in projects is to produce uniform and clean code across different developers.
For any information on SwiftLint, visit the SwiftLint homepage.
Follow our Swift Coding Standard. Doing so ensures these SwiftLint rules are met.
For detailed installation instructions, see SwiftLint homepage. Below are the installation instructions in a nutshell.
This is the preferred way of using SwiftLint in your iOS projects; add the following into your Podfile
:
pod 'SwiftLint'
Of course, do not forget to run pod install
after adding this dependency.
Add .swiftlint.yml
file to your project. This file tells SwiftLint your linter configuration. Use the file from this repository. Place this file in the "root" directory of your iOS project, where .xcodeproj
resides. You do not need to add it into your project.
Add a "Run Script" step to your target's Build Phases, after the Compile Sources step. Enter this as the sole contents of that script:
${PODS_ROOT}/SwiftLint/swiftlint
That's it! This will run SwiftLint every time you Build, and will cause an error for anyone who hasn't installed SwiftLint.