I'm attempting to use SwiftLint version 0.50.1 in my Azure DevOps pipeline to check iOS builds. Currently, the latest SwiftLint version is 0.53.0. However, I encountered some issues while trying to switch to version 0.50.1.
Here's what I tried:
I started by uninstalling the current SwiftLint version using the command 'brew uninstall swiftlint'. Then, I attempted to install SwiftLint version 0.50.1 using 'brew install [email protected]'. However, I received an error message that mentioned 'No available formula with the name "[email protected]".' I also attempted to use 'brew switch swiftlint x.xx.x' to switch to version 0.50.1, but I encountered another error: 'Error: Unknown command: switch.'
I would appreciate some assistance in resolving these issues.
I started by uninstalling the current SwiftLint version using the command 'brew uninstall swiftlint'. Then, I attempted to install SwiftLint version 0.50.1 using 'brew install [email protected]'. However, I received an error message that mentioned 'No available formula with the name "[email protected]".' I also attempted to use 'brew switch swiftlint x.xx.x' to switch to version 0.50.1, but I encountered
According to this document, CocoaPods is the recommended way to install a specific version of SwiftLint since it supports installing a pinned version rather than simply the latest (which is the case with Homebrew).
Taking my demo for example, I added the
Podfile
for myxcodeproj
with contents below.In the pipeline, I used
CocoaPods@0
task to install[email protected]
. Please pay attention to the path where theSwiftLint
was downloaded.Hope the information would help.