I'm integrating SwiftLint, via Cocoapods, into an existing project.
My project directory is as such:
AppNameRepo
|-- AppName
| |--.swiftlint.yml
|--AppName.xcworkspace
|--Pods
And my .swiftlint.yml, as I've tried to exclude pods:
included: # paths to include during linting. `--path` is ignored if present.
- Project
- ProjectTests
- ProjectUITests
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Pods
- ../Pods
- ./Pods
- /Pods
- Project/R.generated.swift
- Project/Pods
I don't really understand what it's resolving the 'Project' tag to, so I'm grasping at straws here to get to exclude the Pod directory that's up a level from where the .swiftlint.yml file resides. I tried moving the .swiftlint.yml up a level, so it sat along side /AppName and /Pods, but then no matter what I changed on the included (which, I didn't think would need to be changed as I assumed it recursively worked in), swiftlint would claim there was no lintable files, so I'm at a loss for next steps.
Since 0.43.0
versión, you need to specify a path relative to the current working directory, so you can use ${PWD}
:
excluded:
- ${PWD}/Pods
Swiftlint is resolving paths relative to itself. Move the .swiftlint.yml
file up a level. Project
should be changed to reflect your AppName folder rather than the project name. Your swiftlint file will look like this:
included:
- AppName
excluded:
- Pods
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With