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

Add configuration to ignore function declaration on line_length rule #975

Closed
serejahh opened this issue Dec 13, 2016 · 4 comments
Closed
Labels
enhancement Ideas for improvements of existing features and rules.

Comments

@serejahh
Copy link

Some native frameworks have really long delegate methods. For example:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView 

And breaking the lines by parameters makes the declaration ugly. Especially when a body is less a declaration

It'd be useful to have a rule which warns about a too long line of code but excludes lines with functions declarations. What do you think?

@marcelofabri
Copy link
Collaborator

Maybe this should be a configuration of line_length rule? See #598 for another proposed configuration.

@marcelofabri marcelofabri added the enhancement Ideas for improvements of existing features and rules. label Dec 14, 2016
@serejahh
Copy link
Author

Looks like a possible solution

@marcelofabri marcelofabri changed the title FuncDeclarationLengthRule Add configuration to ignore function declaration on line_length rule Dec 23, 2016
@mlwelles
Copy link
Contributor

I took a pass at his and just submitted a pull request: #1264

@marcelofabri
Copy link
Collaborator

Fixed by @mlwelles in #1264! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Ideas for improvements of existing features and rules.
Projects
None yet
Development

No branches or pull requests

3 participants