Skip to content

Conversation

fdiaz
Copy link
Contributor

@fdiaz fdiaz commented Jan 14, 2019

Summary

Remove separate long function declarations rule: https://github.com/airbnb/swift/issues/38

Reasoning

Following the new tenet added in this PR #35

Reviewers

cc @airbnb/swift-styleguide-maintainers

Copy link
Contributor

@dfed dfed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking forward to the PR where this rule is re-introduced with an autocorrect!

@ljharb
Copy link

ljharb commented Jan 14, 2019

That tenet uses the word "strive" - that doesn't mean that a non-autocorrectable rule has to be, or even should be, removed from the guide.

@fdiaz
Copy link
Contributor Author

fdiaz commented Jan 14, 2019

@ljharb it does for rules that change the format of our code.

If a rule changes the format of the code, it needs to be able to be reformatted automatically (either using SwiftLint autocorrect or SwiftFormat).

This work is part of the "Plan if this is approved" section of this PR #35

@ljharb
Copy link

ljharb commented Jan 14, 2019

Thanks; if that's what was decided then so be it :-) although there's always going to be things that change the format of the code but aren't safely autofixable, and that's OK.

@fdiaz
Copy link
Contributor Author

fdiaz commented Jan 14, 2019

@ljharb yeah, we've decided that those kind of rules will not belong in our style guide. At the end of last year there was a lot of discussion around this issue and on #35 we finally decided on this direction.

That doesn't mean that all rules need to be autocorrected. Only the ones that modify the format of our code. For more details on what this means see this #34 (comment)

Best practices still have a place to be, and even non-lintable rules too as long as they're heavily justified.

@fdiaz fdiaz merged commit 27a9d5b into airbnb:master Jan 14, 2019
@fdiaz fdiaz deleted the remove-separate-long-function branch January 14, 2019 22:01
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

Successfully merging this pull request may close these issues.

3 participants