Linting your code is an essential step in ensuring the style is consistent across contributors but also over time. Alongside Jazzy, realm also maintains the excellent SwiftLint tool. It is written in Swift and installable through Swift Package Manager (SPM). Now, SPM is not able to install CLI tools. We often turn to Gems or Homebrew to install those. Luckily, thanks to the vibrant Swift community, we can use Mint, the pure SPM for CLI tools.
- In the .gitlab-ci.yml file, you can add the following to create a lint step:
test: image: swift:4.2.1 script: - swift package update - swift test## Add linter steplint: image: swift:4.2.1 before_script: # Keep the current directory in a variable - export PWD=$(pwd) # Install ...