Code formatting automation?

I figured I’d post this here for discussion, rather than cluttering up the issue tracker.

Siril uses K&R style; I have no opinion on this other than “I am lazy and want my editor to format code for me in whatever style a particular project project uses”, so I started looking into the available tools:

First experiment with astyle tells me that Siril only wishes it could use K&R:

$ astyle -n -R --style=kr "*.h" "*.c" "*.cpp" --dry-run | grep "^Unchanged " | wc -l
59
$ astyle -n -R --style=kr "*.h" "*.c" "*.cpp" | grep "^Formatted " | wc -l
283$ git diff | wc -l
198807

Indent is a failure:

$ find . -type f -name "*.h" -o -name "*.c" -o -name "*.cpp" | xargs indent -kr
indent: ./rt/LUT.h:444: Error:Unmatched 'else'
indent: ./rt/LUT.h:471: Error:Unmatched 'else'
indent: ./rt/LUT.h:521: Error:Unmatched 'else'
indent: ./filters/nlbayes/call_nlbayes.h:23: Error:Stmt nesting error.

I see there’s a .editorconfig but that also doesn’t activate K&R mode.

So… what’s the appetite for bulk reformatting all the source code, so that future contributors can just let astyle or vscode take care of formatting.

I’m currently using Eclipse and I have no issue in the automation.
Even if sometimes I want to change minor things, Eclipse do the job.

Siril developers use at least 3 different editors: VIm, Eclipse and vscode. Files were first indented with default VIm settings, Eclipse seems to understand most of it, I don’t know if vscode required settings.