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

Discourage calling init() directly #672

Closed
joshfriend opened this issue May 23, 2016 · 3 comments
Closed

Discourage calling init() directly #672

joshfriend opened this issue May 23, 2016 · 3 comments
Labels
rule-request Requests for a new rules.

Comments

@joshfriend
Copy link
Contributor

The apple language docs always use Foo() style over Foo.init(). While both do the same thing, using .init() seems superfluous.

A check for this rule could find instances of the text .init and verify that it is not preceded by either self, or super.

@mbrandonw
Copy link

You would also want to allow things like optionalString.flatMap(NSURL.init(string:)).

@norio-nomura norio-nomura added the rule-request Requests for a new rules. label May 24, 2016
@joshfriend
Copy link
Contributor Author

Hmm, yes that would make this more tricky...

@norio-nomura
Copy link
Collaborator

implemented on #715 and #826

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule-request Requests for a new rules.
Projects
None yet
Development

No branches or pull requests

3 participants