Menu

#101 Add option indent-class-initializers

None
open
nobody
None
2018-01-29
2017-02-20
No

I think it'd be nice to have indent-class-initializers option exposed in the command line parameters.
Please take a look for a draft implementation: https://github.com/loganek/astyle/commit/2c54138f267ce1d0edc09e11d4807f5ba855920d

Discussion

  • Jim Pattee

    Jim Pattee - 2017-02-20

    I would like to see an example of what the output would look like.
    How would it differ from what is being done now?

     
  • Marcin Mikolaj

    Marcin Mikolaj - 2017-02-21

    Hi Jim,
    So currently there is no option (from the commandline) to control the indent of initializer list - it's always one indent. E.g. code (dots represent spaces):

    Foo::Foo() :
    a(1),
    b(2)
    {}

    Will be indented (assuming that 1 indent = 4 spaces):
    Foo::Foo() :
    ....a(1),
    ....b(2)
    {}

    What I'd like to do, is to indent initializer list more than one unit, e.g.
    Foo::Foo() :
    ........a(1),
    ........b(2)
    {}

     
  • Jim Pattee

    Jim Pattee - 2017-02-21

    This is something that would probably be useful.
    Are you planning on doing it?
    Don't forget about c++11 uniform initializers.
    Be sure to include one or more test cases in AStyleTest.

     
  • Marcin Mikolaj

    Marcin Mikolaj - 2017-02-21

    I might implement this this, however, don't promise (I'm quite busy right now). Let's leave this ticket open, someone can pick it up in the future (me, you, or someone else).

     
  • Jim Pattee

    Jim Pattee - 2018-01-29

    Ticket moved from /p/astyle/bugs/425/

     

Log in to post a comment.

MongoDB Logo MongoDB