Reformatting code before you commit it

Ensure your code is always reformatted before you commit it to VCS

Reformatting Before Commit

If you always want to reformat code in this Project before you commit it, you can do this with the cog in the Commit tool window which is invoked with ⌘0 (macOS) / Alt+0 (Windows/Linux):

Cog in the Commit Tool Window

When you click the cog you'll see this dialog:

Reformat Code Checkbox Before Commit

Select the Reformat Code checkbox and press OK to always reformat your files prior to commit. This will apply to all your languages from your next commit.

Reformatting a Whole Directory

You may have decided to reformat your whole project directory by directory. We'll take a look at how to do this in the next step.