swiftlint opens and closes every file even if excluded (with SPM .build folders causes problems)
Open
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.
$ swiftlint lint .
If using lots of local packages, which include .build directories which include git checkouts, even if excluded, swiftlint opens and closes every file in the directory.
sudo fs_usage -w -f filesystem swiftlint
14:36:22.619133 open F=8 (R_____N____X__) .build/arm64-apple-macosx/debug/index/store/v5/records/0Q 0.000522 swiftlint.4939359
14:36:22.619134 getattrlistbulk 0.000002 swiftlint.4939360
14:36:22.619136 close F=9 0.000011 swiftlint.4939395
for every file...
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 reproducing swiftlint lint . in a project with local packages and .build directories while monitoring filesystem activity with sudo fs_usage -w -f filesystem swiftlint. Trace the directory traversal and exclusion handling to identify why excluded files are opened. Done means excluded .build contents are not opened or closed during linting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- performance, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100