Auto format change brace from a function definition

The auto format from arduino ide 2 beta 7 puts brace behind function definition, while I like to have the braces straight under each other

image

Is there any way I can change this or can this preference be added in a next beta?

Hi @natanassies you can learn about the intended system for customizing the auto format configuration of Arduino IDE 2.x here:

In addition to a similar capability for defining a custom global configuration, as was possible with the classic Arduino IDE, you will also have the new capability to define formatting configurations on a per-sketch basis by adding a .clang-format configuration file to the sketch folder. This could be very useful to ensure consistent code style when collaborating on a project with multiple people, who might have different global configurations.

You can learn about the ClangFormat configuration options here:
https://clang.llvm.org/docs/ClangFormatStyleOptions.html

The last I checked it seemed like the full configurability was not implemented yet, but that was some time ago so maybe it has been finished since. Either way, you can see the roadmap now, and that there will be happy times for lovers of broken braces somewhere down the road.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.

.clang-format files in the sketch root folder are now supported.

Some of the work is done for global custom formatter configuration support, but it is not finished yet. That is being tracked here: