Needs to go over the input twice in order to produce a stable result
GNU indent has issues with very long lines where something->gets->derefed->a->lot->and->even->more
and will toggle back and forth between two indentation schemes for such long derefs across line ends.
In the old gst-indent
we do this:
# Run twice. GNU indent isn't idempotent
# when run once
for i in 1 2; do
$INDENT \
--braces-on-if-line \
--case-brace-indentation0 \
--case-indentation2 \
--braces-after-struct-decl-line \
--line-length80 \
--no-tabs \
--cuddle-else \
--dont-line-up-parentheses \
--continuation-indentation4 \
--honour-newlines \
--tab-size8 \
--indent-level2 \
--leave-preprocessor-space \
$* || exit $?
done
Our gst-indent-1.0
tool needs to do this transparently (we could just point the script to gst-indent-1.0
but that wouldn't work well on Windows I think?)