arduino / arduino/Arduino

option to enable autoformat on save

Open
#11,090 1 comment 0 reactions 0 assignees View on GitHub
Component: IDE feature request
Dominant language
Java
Stars
14.6k
Forks
7k
PR merge metrics
No merged PRs in 30d

Description

Related: https://github.com/arduino/Arduino/issues/2202

I am getting whitespace-spam when doing git diff on a file I edited in another IDE than Arduino IDE. That is due to trailing (=invisible) whitespace being automatically removed by those other IDEs.

Arduino's autoformat function (Ctrl+T) can be used to get rid of those whitespaces. It works very well. I guess I could get used to pressing it before each save, but that will probably not work for my teammates.

Certainly the whitespace-removal can be disabled in the other IDEs (in my case Visual Studio Community & vscode); that would be a solution in my case.

But I'd rather like to have an option in the Arduino IDE to enable autoformat on save. Is there a reason to not include it?

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the Arduino IDE handles save operations and where the existing Ctrl+T autoformat action is implemented. Determine how an opt-in autoformat-on-save setting should interact with saving, then verify that enabling it formats the file and disabling it preserves current behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.