home

Uncrustify use the words « gap », « span » and « threshold » in a way that some people find confusing.

The uses

The uses are fairly homogenous:

Definitions

Here the definitions found in documentation/htdocs/configuration.txt
gap
A 'gap' is the minimum spacing for aligned items.
So, if it is set to 3 for typedefs, then there are a minimum of three spaces between the type and the typedef name.
span
A 'span' is the maximum number of lines that an aligning feature will be considered.
This is done to limit the scope of the aligning. So, if a span is set to 3 and more than 3 lines do not contain the item that is to be aligned, then the aligning set is closed.
threshold
A 'threshold' is the maximum number of columns that an aligning feature will be considered.
This is done to limit the scope of the aligning. This prevents really longs lines from being aligned with short lines.

Confusions

1/ Do these two definitions help you to understand what xxxx and yyyyy are?

NO!
The only thing you can say is that xxxx is about lines and yyyy is about columns.
But you can't say which is a 'gap', a 'span' or a 'threshold'.

2/ The confusion is also due to the usage of maximum or minimum in all three definitions.
If there is a upper or lower limit this is a threshold.

3/ More generally, the explanations for many options are very short and sometime cryptic.

IMHO

It seems to me that, when it comes to alignment, uncrustify uses these 3 words in a suitable but restrictive context:

The technical restrictions (minimum/maximum) and (space/line) are more important than the English definition.


home