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;
}
static_cast is part of C++.
Using a file as example.c, uncrustify uses the C-syntax.
Please change your file name.
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
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