# Minor IDE Auto Format gripe

**URL:** <https://forum.arduino.cc/t/minor-ide-auto-format-gripe/632882>\
**Category:** Suggestions for the Arduino Project\
**Created:** [January 24, 2020, 8:45pm UTC](https://forum.arduino.cc/t/minor-ide-auto-format-gripe/632882 "2020-01-24T20:45:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Geek\_Emeritus](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/geek_emeritus/32/238995_2.png) [@Geek\_Emeritus](https://forum.arduino.cc/u/Geek_Emeritus)\
**Post date:** [January 24, 2020, 8:45pm UTC](https://forum.arduino.cc/t/minor-ide-auto-format-gripe/632882/1 "2020-01-24T20:45:32Z")

</div>

if I auto format this already formatted bit of code I get

```cpp
void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

```

I would much prefer

```cpp
void setup() 
{  // this bracket on the left directly above
}  // its companion bracket. orderly appearance, simpler comparison of opening and closing brackets

void loop() 
{  // this bracket on the left directly above
}  // its companion bracket. orderly appearance, simpler comparison of opening and closing brackets

```

is this an unreasonable request?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [January 24, 2020, 8:52pm UTC](https://forum.arduino.cc/t/minor-ide-auto-format-gripe/632882/2 "2020-01-24T20:52:52Z")

</div>

(deleted)

---

<div class="post-metadata">

**Author:** ![pert](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pert/32/217111_2.png) [@pert](https://forum.arduino.cc/u/pert)\
**Post date:** [January 24, 2020, 8:55pm UTC](https://forum.arduino.cc/t/minor-ide-auto-format-gripe/632882/3 "2020-01-24T20:55:20Z")

</div>

You can configure the Arduino IDE's Auto Format tool to your preference. The file is at {Arduino IDE installation folder}/lib/formatter.conf.

The configuration options for brace style are documented here:

> **[Artistic Style](https://astyle.sourceforge.net/astyle.html#_Basic_Brace_Styles)**
>
> Artistic Style is a source code indenter, source code formatter, and source code beautifier
> for the C, C++, C# and Java programming languages.

So if you like the Allman brace style, you would add this to the file:

```cpp
style=allman

```

---

<div class="post-metadata">

**Author:** ![GaryP](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@GaryP](https://forum.arduino.cc/u/GaryP)\
**Post date:** [January 26, 2020, 8:38am UTC](https://forum.arduino.cc/t/minor-ide-auto-format-gripe/632882/4 "2020-01-26T08:38:58Z")

</div>

Thank you!

I didn't understand to ask this, I just suffer in silence!!!

Cheers,  
Kari

---

<div class="post-metadata">

**Author:** ![pert](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pert/32/217111_2.png) [@pert](https://forum.arduino.cc/u/pert)\
**Post date:** [January 26, 2020, 8:57am UTC](https://forum.arduino.cc/t/minor-ide-auto-format-gripe/632882/5 "2020-01-26T08:57:28Z")

</div>

You're welcome. I'm glad if I was able to be of assistance.

One thing I should mention is that if the Arduino IDE is running you need to restart it before changes to formatter.conf take effect.

Also note the helpful comment in formatter.conf:

```cpp
# If you wish to change them, don't edit this file.
# Instead, copy it in the same folder of file "preferences.txt" and modify the copy. This way, you won't lose your custom formatter settings when upgrading the IDE
# If you don't know where file preferences.txt is stored, open the IDE, File -> Preferences and you'll find a link

```

You can find the location of the folder by clicking the link on the line following "More preferences can be edited directly in the file" in the Arduino IDE's **File \> Preferences**.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 12:04pm UTC](https://forum.arduino.cc/t/minor-ide-auto-format-gripe/632882/6 "2021-05-06T12:04:09Z")

</div>

Closed on May 6, 2021, 12:04pm UTC


