Incorrect indentation in some multiline conditional compilation directives #7820
Labels
bug
component-test
Test framework and CI scripts
help-wanted
This issue is not being actively worked on, but PRs welcome.
priority-low
Low priority - this may not receive review soon
The tool we use for code styling (uncrustify) has a bug that causes it to use misleading indentation in continuation lines for conditional compilation directives. For example:
We'd like
defined(MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH)
to be left-aligned withdefined(MBEDTLS_SSL_RENEGOTIATION)
so that it's obvious to the reader that this is1 && (2 || 3)
and not(1 && 2) || 3
. But that's not what we get from uncrustify.This is just a code readability issue — it doesn't affect the behavior of the code, unless of course someone who edited it was mislead by the presentation.
You can use the following one-big-liner to look for problematic lines (many of them exhibit an instance of the bug):
This issue exists so that we can remember the readability issue if it comes up again in code reviews, and as a repository for any investigation we do towards a solution. Definition of done: we find a way to no longer have this misleading indentation, either by upgrading uncrustify if the bug gets fixed, or by tweaking the configuration if we find a workaround.
The text was updated successfully, but these errors were encountered: