Using SKitten to create LinuxMain.swift file
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 2.4k
- Forks
- 237
- PR merge metrics
- No merged PRs in 30d
Description
Would it be possible? I've been trying to make a decent python script to do this, but the lack of semantics makes it fragile: I can't know whether a class inherits from XCTest or know the relationship between two classes in different files. E.g: Foo inherits from Bar, and Bar inherits from XCTest, but in an extension. The combinations are endless, which seriously limits what I can make with just regexes. I'd need to make a compiler to address those issues 😅
Which brings me to SourceKit and therefore, SourceKitten. Could I do something like this:
- In a directory, get all Swift files and extract the classes that inherit from XCTest from them.
- Then, for each class, extract the names of all test methods that belong to it.
Just that would suffice. The rest is easy and does not require semantic knowledge (it's just string manipulation from then on).
Could I do this with SourceKitten?
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 checking the SourceKit and SourceKitten interfaces for semantic information about Swift inheritance, extensions, and XCTest methods. Done means determining whether those queries are supported and documenting the relevant approach or the limitation; no source files or tests are identified in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100