So far what I found is this blog article: It's time to use Swift Package Manager which recommends integrate SwiftLint and other tools with Package.swift
.
I was able to add dependency to the package file, build and test successfully but SwiftLint never warns me about syntax violations.
Before we used this Build Phases step in Xcode project:
if which swiftlint >/dev/null; then
swiftlint
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
The article suggests adopting Komondor which itself useless without PackageConfigs. The idea is to run SwiftLint command during commit. I have tried to add both projects and couldn't get it working in reasonable amount of time. During commit, I see warnings like this:
Illegal instruction: 4 $komondor run pre-commit
This is still early days for Swift Package Manager and there's almost no information on the internet.
Ideally I would like to have any solution which allows our team to automate SwiftLint, and ideally that wouldn't require adding 22 dependencies, config files, and require dynamic library.