Menu

#657 embedded comment position changes when pos_class_comma contradicts pos_comma

Future
fixed
nobody
None
5
2016-03-18
2015-12-18
Pavel Busko
No

1) use ben's config as a starting point
2) change the following properties:

nl_class_init_args=force
pos_comma=trail
pos_class_comma=lead

3) try to format the following code:

class NavigatedScreen: public UIScreen/*somecomment*/, public SomeClass

4) that's what you get:

class NavigatedScreen : public UIScreen
                        , /*somecomment*/ public SomeClass

/somecomment/ changed it position relative to comma and now it looks like it's related to SomeClass, not to UIScreen!

Discussion

  • Pavel Busko

    Pavel Busko - 2015-12-18

    Something happened to the formatting and I can't find a way to edit bug desription. So I'll just try to repost formatted code as a comment:

    Code in point 3 is:

    class NavigatedScreen: public DAVA::UIScreen/*somecomment*/, public SomeClass
    

    and what I get after formatting looks like this:

    class NavigatedScreen : public DAVA::UIScreen
                            , /*somecomment*/ public SomeClass
    
     

    Last edit: Pavel Busko 2015-12-18
  • Guy Maurel

    Guy Maurel - 2016-01-11

    You need to use the option pos_comma=lead_force

     
  • Pavel Busko

    Pavel Busko - 2016-02-01

    You need to use the option pos_comma=lead_force

    The thing is that I don't want - in our code style we want to have trailing comma everywhere except for constructor initialization list and class base list.

    If pos_comma can't contradict pos_class_comma this fact should be explicitly mentioned in documentation.

     
  • Guy Maurel

    Guy Maurel - 2016-02-13

    Thanks for the bug.
    Bug # 657 is fixed.
    Takes care of the option pos_class_comma.
    Have a look at https://github.com/gmaurel/uncrustify4Qt.git
    2016-02-13 17:48:59

     
  • Pavel Busko

    Pavel Busko - 2016-02-16

    Thanks!

     
  • Ben Gardner

    Ben Gardner - 2016-03-18
    • status: open --> fixed
     
MongoDB Logo MongoDB