CUBE IDE and code style checker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
- Labels:
-
STM32CubeIDE
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-10-28 5: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-10-24 11:40 PM
Hi
@Erwan LE-SAINT​ @Imen DAHMEN​
can one of you comment on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-10-25 5:22 AM
Hello, after checking with IDE developers, no change of setup from Eclipse preferences from CubeIDE.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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
- K&R
- BSD/Allman
- GNU
- Whitesmiths
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-10-27 3:26 AM
This would be a very useful feature.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-10-28 5: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.
