Menu

#675 sp_*_angle = remove not applied

Future
closed
None
C++
5
2016-07-20
2016-06-01
Massimo B.
No
uncrustify --version;cat crusty-test06.cpp;cat crusty-test06.cpp | uncrustify -c ~/.uncrustify.cfg 
uncrustify 0.62
 if(!errorCode2String.contains(static_cast<GsCm::ErrorCode::type> (errCodeStr.toInt()))) {
     return;
 }
Parsing: 107 bytes (107 chars) from stdin as language C
if( !errorCode2String.contains( static_cast < GsCm::ErrorCode::type > ( errCodeStr.toInt() ) ) ) {
    return;
}

With this configuration I would have expected the following:

grep "_angle" ~/.uncrustify.cfg
sp_template_angle                         = remove   # ignore/add/remove/force
sp_before_angle                           = remove   # ignore/add/remove/force
sp_inside_angle                           = remove   # ignore/add/remove/force
sp_after_angle                            = remove   # ignore/add/remove/force
sp_angle_paren                            = remove   # ignore/add/remove/force
sp_angle_word                             = force    # ignore/add/remove/force
sp_angle_shift                            = force    # ignore/add/remove/force
uncrustify --version;cat crusty-test06.cpp;cat crusty-test06.cpp | uncrustify -c ~/.uncrustify.cfg 
uncrustify 0.62
 if(!errorCode2String.contains(static_cast<GsCm::ErrorCode::type> (errCodeStr.toInt()))) {
     return;
 }
Parsing: 107 bytes (107 chars) from stdin as language C
if( !errorCode2String.contains( static_cast<GsCm::ErrorCode::type> ( errCodeStr.toInt() ) ) ) {
    return;
}
1 Attachments

Discussion

  • Guy Maurel

    Guy Maurel - 2016-07-14
    • status: open --> closed
    • assigned_to: Guy Maurel
     
  • Guy Maurel

    Guy Maurel - 2016-07-14

    static_cast is part of C++.
    Using a file as example.c, uncrustify uses the C-syntax.

    Please change your file name.

     
  • Massimo B.

    Massimo B. - 2016-07-18

    Sorry, what do you mean with "Using a file as example.c [...] Please change your file name"?

    My file is named crusty-test06.cpp and is not equal to *.c

     
  • Guy Maurel

    Guy Maurel - 2016-07-20

    Using a pipe prevents uncrustify to choose the right language and take "C".
    You can:
    use uncrustify -c uncrustify.cfg -f crusty-test06.cpp
    or tell uncrustify which language you need:
    cat crusty-test06.cpp | uncrustify -l cpp -c uncrustify.cfg

     
Auth0 Logo