Until now, we haven’t been able to use Hound on an iOS project. In order to lint Objective-C or Swift code, we needed to be able to run the linters – the executables that validate the code – on a Mac server. However, historically Hound has been deployed on Heroku, which only has GNU/Linux servers.
Last year, Hound’s linters were made to run on a service-oriented architecture. Because of this change, we could run a Mac in the cloud which made implementing support for Objective-C or Swift possible. We chose to rent a Mac mini from MacStadium because it provided the least friction to get one up and running. Because of our excitement about Swift, we decided to give implementing a service for it a shot.
The only problem was that we still needed a linter.
Lo and behold, in May 2015, Realm released SwiftLint which does just that. Some discussion and a bit of work later, Hound supports Swift!
Enabling Swift in Hound
You can enable Hound for your Swift project by editing the
.hound.yml in your
repo. If you want to provide a [custom configuration for SwiftLint]swiftlint
config, you will need to add the
config_file key like in the example below.
swift: enabled: true config_file: .swiftlint.yml
Like the rest of Hound, hound-swift is open-source!
We think Hound is the best way to add style-checking to your workflow. Since it’s free for open source projects, it couldn’t be easier to get started.