score:0

  1. go to window > preferences > java > editor > save actions.
  2. select perform the selected actions on save.
  3. select format source code.
  4. select format edited lines.
  5. click ok, edit some code, save it and watch eclipse format it automatically.

more details are here, and also check the official help.

enter image description here

score:1

  1. select all in git staging view
  2. right-click on the files
  3. click on show in > package explorer <code>show in</code> > <code>package explorer</code>
  4. right-click on the selected files in the package explorer
  5. click on source > clean up... ou format <code>source</code> > <code>clean up...</code>

ps: you can do this for former commits:

  1. show git history in history
  2. select your commit
  3. select all the files on the right
  4. right-click on the files
  5. click on show in > package explorer
  6. right-click on the selected files in the package explorer
  7. click on source > clean up... ou format

Related Query

More Query from same tag