-
-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude public option #34
Conversation
Love the Swift bit! At the time I didn't really understood how SourceKit worked, so I got the API to work by ripping wrappers around the web... Definitely a good time to write our own version of the API! I've seen you noticed that @hadiidbouk was already investigating this - I think that's a great way to do it but I do think it shares the problem where the methods declared inside public protocols will not be avoided, right? |
@@ -108,6 +111,21 @@ extension AutomaticSwiftShield { | |||
guard let name = dict.getString(key: sourceKit.nameID)?.trueName, let usr = dict.getString(key: sourceKit.usrID) else { | |||
return nil | |||
} | |||
|
|||
if excludePublic { | |||
let attribtuesArray = dict.getDictionaryValue(key: sourceKit.attributesId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Typo on attribtuesArray
Yes I guess it should share the problem with protocols. Feel free to ignore this PR and wait for @hadiidbouk to finish his solution :-) |
@hadiidbouk When are you going to push your changes? I think we can work together on this one 🙂 |
I will push all the code tonight 👍 |
I'll close this because we have 3 PRs for the same feature, so I'm keeping only the original one. |
Glad to help 👍 |
Hey, this PR adds support for a new flag
-exclude-public
.It is a minimal thing. It doesn't support other access flags like internal, but it shows the way and gets the job I need done.
Btw the way you get
sourcekitd
stuff is quite unswifty, check out this code from Apple guys: https://github.com/apple/swift/blob/master/tools/SourceKit/tools/swift-lang/SourceKitdResponse.swiftYou might just love it ;-)