realm / realm/SwiftLint

Swiftlint with Exclusions takes up to 10 minutes, --use-alternative-excluding can't be used as PluginBuildTool

Open
#6,084 0 comments 0 reactions 0 assignees View on GitHub

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
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.

Image
Image

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.