[PATCH] Add clang-format option for ensuring newlines after @(interface|implementation|protocol) and before @end

Daniel Jasper djasper at google.com
Mon Apr 14 00:40:22 PDT 2014


Hi,

thanks for working on this.

+**ObjCNewlinesBetweenDeclarations** (``bool``)
+  Add a line break before and after Objective-C declarations.
+

Just generate this with cfe/docs/tools/dump_format_style.py.


Also, please at tests for the different cases where you'd want to insert a
newline or not (similar to the "RemovesEmptyLines" test).

Cheers,
Daniel


On Mon, Apr 14, 2014 at 9:22 AM, Allen Ding <alding at gmail.com> wrote:

> Hi all,
>
> Made the following patch for use internally for our iOS projects.
> Wondering if it would be useful to other clang-format users.
>
> Before:
> @interface Foo : NSObject <NSSomeDelegate>
> - (id)init;
> @property(nonatomic) NSInteger whizzy;
> @end
>
> After:
> @interface Foo : NSObject <NSSomeDelegate>
>
> - (id)init;
> @property (nonatomic) NSInteger whizzy;
>
> @end
>
> Regards,
>
> --
> Allen Ding
> Lentor Solutions
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140414/78ab7bf3/attachment.html>


More information about the cfe-commits mailing list