Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly does Cleanup in Commit Changes dialogue of IntelliJ means

There are several check boxes when a user tries to commit or push changes, using IntelliJ, in the dialogue box shown below.

I pretty much understand all other options, but I'm not sure exactly what Cleanup does?

enter image description here

I tried reading documentation and found this link, https://www.jetbrains.com/idea/help/commit-changes-dialog.html.

It says

Cleanup - Select this check box if you want to automatically apply the current inspection profile to the files you are going to commit.

But I'm still not sure what it means and what exactly it checks or fixes automatically in source code.

like image 819
Shrikant Havale Avatar asked Nov 24 '15 15:11

Shrikant Havale


People also ask

What does IntelliJ cleanup code do?

tip. You can also run code cleanup using the command-line utility. JetBrains Rider allows you to apply formatting and other code style preferences in a bulk mode to instantly eliminate code style violations in one or more files, in a project or in the entire solution.

How do I see committed changes in IntelliJ?

IntelliJ IDEA lets you review the state of your project at a selected revision. Open the Git tool window Alt+9 and switch to the Log tab. Select a commit and choose Show Repository at Revision from the context menu.

What is commit in IntelliJ?

Commit part of a file IntelliJ IDEA lets you commit such changes separately in one of the following ways: select modified code chunks, that you want to include in a commit right in the Commit Changes dialog and leave other changes pending so that you can commit them later.

How do I change the commit message in IntelliJ?

Edit a commit message Right-click the commit whose message you want to edit in the Log tab of the Git tool window Alt+9 and select Edit Commit Message from the context menu, or press F2 . In the dialog that opens, enter a new commit message and click OK.


1 Answers

There are a bunch of inspections that are marked as Cleanup. They mostly consist of code style inspections and all have a quickfix to fix the problem they detect. In the inspection settings (File | Settings | Editor | Inspections) you can filter the list to Show Only Cleanup Inspections, to see which ones they are.

When you select the Cleanup checkbox in the commit dialog, all cleanup inspections you have enabled in the current inspection profile will check the files you are committing and apply the quickfixes if any problem is found before committing to the version control server.

like image 151
Bas Leijdekkers Avatar answered Oct 24 '22 21:10

Bas Leijdekkers