[Development] Resolving coding style contentions

Matthew Woehlke mwoehlke.floss at gmail.com
Thu Nov 22 17:41:04 CET 2018


On 22/11/2018 04.30, Frederik Gladhorn wrote:
> Does Uncrustify support ranges so it will 
> only re-format the parts of a file that were touched?

I don't think so, though if someone cared enough, it might be possible
to add that. (Uncrustify tracks the original location of its tokens, so
plausibly you could make it output only the selected range after
reformatting.)

However... I think ranges are a crutch. If a file is correctly formatted
to begin with, I don't see any value in only formatting a range. I'm
also concerned there could be instances when trying to only format a
given range could lead to errors. (Maybe the range is a "hint" which can
be expanded until the formatted and original output have a line break at
the same token? But even this might result in screwy formatting...)

BTW, while there are hopefully few if any left, what does clang-format
do to normalized SIGNAL/SLOT?

-- 
Matthew



More information about the Development mailing list