You can also use any command line code formatter like "astyle" or "clang-format" which support reading the code from standard input and writing the code to standard output.
Then configure a "send selection to" command in Geany with the formatter. To use it, simply mark all code or only portions of it and use "send selection to".
For details see the documentation at https://www.geany.org/manual/current/index.html#sending-text-through-custom-.... This feature is builtin and does not need any plugins.