How to install a specific version of swiftlint?

RainCast picture RainCast · Jan 26, 2017 · Viewed 15.1k times · Source

I am trying to fix this error:

Error: swiftlint does not have a version "0.11.1" in the Cellar.

by running this:

brew install swiftlint-0.11.1

however this doesn't work, then I tried "brew search swiftlint", but nothing showed up.

Can anyone point to me the correct way to install swiftlint with a specific version?

Answer

eric long picture eric long · Feb 17, 2017

Go to /usr/local/Cellar/swiftlint you will see all installed switflint version.
Copy swiftlint version folder from other Mac then paste into /usr/local/Cellar/swiftlint

You could check all versions in your Mac by brew info swiftlint

Switch to version you need by brew switch swiftlint x.xx.x

I uploaded some version ==> here

Update: Now you could use pods for this.

My project is using swift2.2 with SwiftLint 0.12.0 installed via brew.

And I decided to change to Pod. There are many changes and errors in each versions. My project is too big, and it's take time to fix all the error and warning (it may effect to current features also...).

Finally I choose pod 'SwiftLint', '0.16.0' and. disable_rules then I don't need to fix any warning nor error.

  • type_name
  • shorthand_operator
  • unused_closure_parameter