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

Exclude init functions from function_parameter_count rule? #839

Closed
delebedev opened this issue Oct 14, 2016 · 2 comments
Closed

Exclude init functions from function_parameter_count rule? #839

delebedev opened this issue Oct 14, 2016 · 2 comments

Comments

@delebedev
Copy link
Contributor

delebedev commented Oct 14, 2016

I have a lot of immutable models in the project (probably everyone has nowadays).

    //swiftlint:disable function_parameter_count
    init(ID: Int, stripeID: String, last4: String, vendor: String, expirationMonth: Int, expirationYear: Int) {
        self.ID = ID
        self.stripeID = stripeID
        self.last4 = last4
        self.vendor = vendor
        self.expirationMonth = expirationMonth
        self.expirationYear = expirationYear
    }

Almost every of them triggers function_parameter_count.
It also happens with a lot of services/viewModels due to heavy usage of constructor injection.

When I implemented this rule first I was thinking about it as a guideline which helps to expose "complex" behaviours and function calls, but I tend to think now that init should be excluded by default.
Happy to do a PR but it's a controversial change so should be discussed first.

@norio-nomura
Copy link
Collaborator

This is a duplicate of #544.

@norio-nomura
Copy link
Collaborator

I think PR will be welcomed! 😃

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

No branches or pull requests

2 participants