Formatting the source code can either be done by the editor, or many GUIs already contain it. The STM32CubeIDE, for example, is able to apply such formatting as an Eclipse variant with so-called profiles. Some profiles are already predefined, but you can also modify them and save or export them under your preferred name.
By the way, exporting a profile is very useful because you can import the exported profile into new installations with just a few clicks.
How to reach the Formatter:
- Windows > Preferences > C/C++ > Code Style > Formatter
or a little shorter:
- Windows > Preferences > [type filter text] --> formatt
Modify an existing profile:
- within the Formatter via New > [new profile name] + select the profile to be used as a template
- Adjusting the 65 million parameters (after that it is clear why Export is extremely useful)
- Export
- save with OK
Export:
- within the Formatter via Edit > Export
Perhaps my Kernighan&Richie-derived Quick'n'Dirty profile (attached) will be of interest to you and could serve as a template.
Regards
/Peter
In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.