Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install a specific version of swiftlint?

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?

like image 484
RainCast Avatar asked Jan 26 '17 03:01

RainCast


People also ask

How do I know which version of SwiftLint is installed?

Go to /usr/local/Cellar/swiftlint you will see all installed switflint version.

How do I install a specific version of an app with BREW?

To save you some time, here's how to do it: You create a local “tap” - which I assume is something like a local brew repository. You extract the desired version of the package into this local tap. You install your local tap.

How do I update my SwiftLint?

You can easily install SwiftLint using Homebrew: $ brew install swiftlint . If you have already installed SwiftLint, you can update it to the latest version using the $ brew upgrade swiftlint command. NOTE: Please update Homebrew to the latest version before installing and updating SwiftLint: $ brew update .


2 Answers

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
like image 96
eric long Avatar answered Oct 12 '22 13:10

eric long


Just go to Swiftlint release page and select the appropriate version.

Download it and extract it.

You should be able to see an executable and a licence txt file.

Now go to /usr/local/Cellar/swiftlint and create a folder with the version (for ex. 0.35.0).

Create a bin folder inside it and paste the swiftlint executable that you have downloaded.

Brew now shows the custom version that you have downloaded . You can check by typing brew info swiftlint in cmd you can switch by brew switch swiftlint version_number

like image 22
Haseeb Mohamed Avatar answered Oct 12 '22 12:10

Haseeb Mohamed