Let’s add the CocoaPods gem in the Gemfile and run bundle install on the command line ( GitHub commit).Īfter this is done, navigate to the iosApp directory and run bundle exec pod init ( GitHub commit). To install SwiftLint I will use CocoaPods, so before doing so, I will have to install CocoaPods in the project. I will put a few references on separate GitHub commits for you to follow along. Swift code stylingĪ while ago, I have written a post about SwiftLint, so I will not go in depth, but rather focus on installing, configuring and using SwiftLint. Without further ado, let’s move to action starting from the iOS project and setting up SwiftLint. Tools like SwiftLint for Swift projects and detekt for Kotlin projects enable us to set some rules that we would like our codebase to follow and let us know in case we break some of them. Since the project consists of two languages ( Swift and Kotlin), we will have to implement different solutions for each of them. This project is also available on GitHub. Linting is here to help you alleviate those scenarios and eventually increase readability of your code base, make it more consistent in case your are working on a team and eliminate the code smells.įor this post, I will make use of the project created on the previous posts related to Kotlin Multiplatform Project, about setting up a project, applying some changes in the default structure and setting up unit tests. How many times have you ended up with a bunch of unused import on an Android project or using for example unt = 0 instead of array.isEmpty on an iOS app? Continuing my journey on Kotlin Multiplatform Project, this time I will explore some tools that can be used to apply code style conventions on such projects.
0 Comments
Leave a Reply. |