kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #39913
Re: Formatting: break after templates
-
To:
kicad-developers@xxxxxxxxxxxxxxxxxxx
-
From:
Wayne Stambaugh <stambaughw@xxxxxxxxx>
-
Date:
Wed, 27 Mar 2019 09:30:27 -0400
-
In-reply-to:
<CAG1r56+gWhaRvRX05xbxeFnk6dKpD1dG=4-ULooE8UbeZVEEZQ@mail.gmail.com>
-
User-agent:
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0
I don't have a preference on this so I'm fine with the proposal. We
have very few templates in the KiCad source so it's impact is low.
On 3/26/2019 8:28 AM, John Beard wrote:
> Oops, missing newline in the "after" case: should be:
>
> template <>
> struct STRUCT_TYPE<TYPE>
>
> On Tue, Mar 26, 2019 at 12:26 PM John Beard <john.j.beard@xxxxxxxxx> wrote:
>>
>> Hi,
>>
>> Quick question about formatting: clang-format says
>> "AlwaysBreakTemplateDeclarations: false", which can produce things
>> like this:
>>
>> template <typename FOO> void function( int aParam )
>>
>> template <> struct STRUCT_TYPE<TYPE>
>>
>> I think it's clearer if the template declaration is always broken
>> after ("AlwaysBreakTemplateDeclarations: true"):
>>
>> template <typename FOO>
>> void function( int aParam )
>>
>> template <> struct STRUCT_TYPE<TYPE>
>>
>> This keeps the function signature in the "normal" format (i.e. return
>> type on the left), and puts the "struct" or "class", etc, in the
>> "normal" place too.
>>
>> There aren't that many cases of either, but newline cases win by count
>> (77 to 10). the Uncrustify.cfg file agrees with newline:
>>
>> nl_template_class = force # line 1076
>>
>> The style guide has no mention of it.
>>
>> Cheers,
>>
>> John
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
Follow ups
References