2021-10-22 12:07 AM
Hi folks,
STM32CubeIde /eclipse comes with a code style checker. I just ran it. The default settings do not cover ST's code style. Is it possible to get a config file so CubeIde automatically checks for STM32s coding guidelines?
Is ST development team using any code style checker?
Thanks
Solved! Go to Solution.
2021-10-28 05:53 AM
If it isn't too hard, could you provide a formatter xml for "ST HAL" style and make it selectable from Preferences? Indeed this will save hassle for new users.
2021-10-24 11:40 PM
Hi
@Erwan LE-SAINT @Imen DAHMEN
can one of you comment on this?
2021-10-25 05:22 AM
Hello, after checking with IDE developers, no change of setup from Eclipse preferences from CubeIDE.
Regards,
2021-10-26 11:14 PM
Hi @dieter 123,
The code style/formatting supported by CubeIDE is provided as-is from Eclipse/CDT. This means you can select between a number of different styles, you can see the options in this menu: Window > Preferences > C/C++ > Code Style > Formatter
None of these are however used internally at ST when developing the STM32Cube packages. This has legacy reasons. The Cube packages are instead closer to ANSI. Not sure which one is closest to ANSI, possibly BSD/Allman. But indentation is not correct. This can however be modifed in:
Window > Preferences > C/C++ > Code Style > Formatter > BSD/Allman > Edit > Indentation.
The formatting will however not be identical. It may be possible to setup an identical profile in Eclipse. Nothing I have tried.
It may also be possible to rely on an external tool to achieve this.
2021-10-27 03:26 AM
This would be a very useful feature.
2021-10-28 05:53 AM
If it isn't too hard, could you provide a formatter xml for "ST HAL" style and make it selectable from Preferences? Indeed this will save hassle for new users.