-
Notifications
You must be signed in to change notification settings - Fork 233
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
Suggestion: a new rule NoEmptyLinesOpeningClosingBracesOnMethods
- No empty lines on opening or closing braces in methods only
#819
Comments
Synced to Apple’s issue tracker as rdar://136754857 |
These are the kinds of extremely fine-grained customizations that I'm really hesitant to add. |
This request stems mostly from this our team's preference and our desire to be able to configure the formatter to our liking. However, this also seems to be the formatting used in Apple's example projects like |
@allevato Any plans on supporting custom rules? |
If by "custom rules" you mean some sort of plugin architecture where users would write something like a .dylib that contained additional rules that swift-format would recognize, it would be very nice to support something like that but we'd have to figure out the architectural details for it. |
@allevato Yeah, that is exactly what I was imagining. I would love to contribute to the architectural design and the implementation of it. Let me know how I can best contribute to that with you :) |
The existing rule
NoEmptyLinesOpeningClosingBraces
is somewhat too much of a catch-all rule. I'd like to request a more fine-grained rule where empty lines on opening or closing braces would be disallowed for methods, but allowed for type declarations.For example the following would be disallowed within the rule
whereas the following would be allowed
The text was updated successfully, but these errors were encountered: