Skip to content

How do you add SwiftLint into an Xcode project? #2963

Closed Answered by jpsim
cordechasse asked this question in Q&A
Discussion options

You must be logged in to vote

This is a question about SwiftLint, but these instructions are applicable for running any other script or CLI tool on pre-build Xcode actions.

We use SwiftLint as part of a pre-build phase for our rules_xcodeproj project and set it up this way:

First, we have a shell script wrapper that can download and run a prebuilt SwiftLint binary pinned to a specific version, so that devs don't all have to install it via Homebrew where the versions can easily get out of sync.

It looks like this:

#!/bin/bash

set -euo pipefail

readonly swiftlint_version="0.53.0"
readonly swiftlint_version_sha="8a949e9e8113ba0f60d69275e444a3ec78adb9598f2b93579bcaf2bb568950e5"
readonly swiftlint_version_url="https://gi…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by BalestraPatrick
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants