realm / realm/SwiftLint

swiftlint opens and closes every file even if excluded (with SPM .build folders causes problems)

Open
#6,259 2 comments 2 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
$ 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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.