Problems with dune-uncrustify.cfg
The official dune-uncrustify.cfg
config linked on the webpage contains two problems:
- The option
align_number_left
is unknown to recent uncrustify versions (at least the one on Ubuntu 23.10). - The indentation of lambda functions is far from optimal: The whole lambda (body and closing brace) is additionally indented to align with the capture block
[...]
. This has a few nasty side effects:- If the name of the lambda object is modified, the whole block needs to be reindented which may clutter diffs significantly.
- Depending on the lambda name this may leads to odd indentations which does not align well with how editors handle indentation.
- IMO (but this is probably a matter of taste) the indentation should reflect code structure. Here it depends on names.
- This may lead to very long lines when using long meaningful names for lambdas.
It seems that the second problem can be solved by indent_cpp_lambda_only_once=true
. But this should be checked by someone regularly using uncrustiy.