Swiftlint with Exclusions takes up to 10 minutes, --use-alternative-excluding can't be used as PluginBuildTool
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 19.7k
- Forks
- 2.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 11
Description
New Issue Checklist
- I've Updated SwiftLint to the latest version.
- I've searched for existing GitHub issues.
Bug Description
There are many (not only open) issues (https://github.com/realm/SwiftLint/issues/5018, https://github.com/realm/SwiftLint/issues/6028, ...) about Swiftlint being extremely slow when exclude contains bigger folders or ** pattern.
We were until now using post build script step with --use-alternative-excluding that worked fast, but had some other issues. We switched to Plugin build tool and are now correctly seeing Swiftlint run on each build, but for some folks on our team this procedure takes even 10 minutes on compile.
One comment (https://github.com/realm/SwiftLint/issues/5018#issuecomment-1664392260) already mentioned this, but no official issue / feature request was created, so here we are.
Is there a way to enable --use-alternative-excluding for Build Plugin Tools (aka param inside .swiftlint.yml or is this the right time to make alternative excluding default? Or will this forever be only command line param without option to use it via config file?
Environment
- SwiftLint version latest
- Xcode version latest
- Installation method used - SPM
- Configuration file: Doesn't matter as long as exclude contains bigger folders / more files
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the Swift Package Manager build plugin handles --use-alternative-excluding and how .swiftlint.yml options are parsed. Compare the plugin path with the post-build script behavior described in the issue; done means large exclusions no longer cause multi-minute plugin builds and the behavior is explicitly configurable or intentionally made the default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- performance, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100