Build Phase to enforce minimum SwiftLint version

If your team is using brew to install SwiftLint, you might run into scenarios where different developers run different versions of the linter.

One way to avoid this issue is to enforce a minimum version.

Here is a snippet of a Build Phase that accomplishes that:

When trying to build an app with an older version installed, an error would be thrown:

If you want everyone to run the exact same version, just modify the condition in the snippet above:

if [[ "$SWIFTLINT_VERSION" == "$MIN_VERSION" ]]; then

Build Phase to enforce minimum SwiftLint version | manu.show
Tags: iOS tools
Share: Twitter LinkedIn