We are using Eclipse save actions to strip trailing white-space, organize imports and some rudimentary code formatting. This was not always so, and the project is quite big and old so many times when we edit a file we get a lot of source control changes that are not immediately relevant to the commit. What we often do then is that we commit the formatting without the code change separately and then the code change on top of that.
It would be very convenient to be able to just run the save actions on every Java file in our project and then commit that once and for all, but I haven't been able to figure out a way to do that. How can this be achieved?
The Save Actions Preferences page is accessed from Window | Preferences | PHP | Editor | Save Actions . To configure Save Actions: Mark the 'remove trailing whitespace' checkbox to enable the removal of whitespace after every save.
Under preferences General->Workspace, there's an "Save automatically before build" option.
Right click on the project, choose Source
-> Clean up...
to run the save actions, and under Source
you will also have Organize imports
and Format
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With