Skip to content
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

Support for fileprivate on @IBOutlet rule #831

Closed
kdawgwilk opened this issue Oct 8, 2016 · 4 comments
Closed

Support for fileprivate on @IBOutlet rule #831

kdawgwilk opened this issue Oct 8, 2016 · 4 comments

Comments

@kdawgwilk
Copy link

A similar case to #781 which would basically treat fileprivate and private the same. The reason I would like this is because I like to put logic inside extensions to my class to keep things organized and leaving them as private doesn't allow them to be accessible in an extension even if its defined in the same file.

@AliSoftware
Copy link
Contributor

I wonder if we could do that via a Rule Configuration (instead of allowing both private and fileprivate in the rule for everybody)?

This way in your .swftlint.yml you could do whatever you prefer, with something like this:

iboutlet_access:
  scopes: [private, fileprivate]

If we go that route, we might as well accept people to configure it for internal (or even public?), So we might as well consider renaming the rule to iboutlet_access_scope or something similar

@samdods
Copy link

samdods commented Nov 8, 2016

any update on this? i'm happy to work on it, but would be inclined to keep it simple to begin with and just make the change as per the OP.

of course i agree @AliSoftware is a more long term solution. (although now i think about it, public is probably even more useful than internal in terms of outlets. separation of concerns would suggest you'd keep all outlets private or fileprivate unless you're making some kind of generic, reusable user interface component that can be used across projects, where each project would hook up the outlet in a custom IB file). in which case you'd be building a framework and want your outlet public.)

anyone already working on it?

@AliSoftware
Copy link
Contributor

I won't be working on it anytime soon at least (I have already to much work on other OSS projects including mine 😜) so feel free to start this one up!

norio-nomura added a commit that referenced this issue Nov 30, 2016
* commit '83830861d6c6b7fee3218461f699c7d3b457bf2a':
  refactor isPrivateLevel(identifier:)
  refactor nameStrippingLeadingUnderscoreIfPrivate
  combine changelog entries for #781 and #831
  Add support for filePrivate and open in rules

# Conflicts:
#	Source/SwiftLintFramework/Extensions/String+SwiftLint.swift
#	Source/SwiftLintFramework/Rules/MissingDocsRule.swift
@marcelofabri
Copy link
Collaborator

This was resolved on #905. Feel free to open a new issue/PR to address the configuration stuff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants