Is there a way to apply new formatting rules for existing code in IntelliJ like how Eclipse does upon saving files?
For example in Eclipse, the "on save actions" can be configured with additional settings like:
- Insert
finalkeyword wherever applicable (method arguments, object fields etc.) - Wrap single line control statements with braces.
- Remove unused variables/private methods.
These would work for both new and existing code upon saving the file.
Although we can configure IntelliJ to follow these rules for new code, is there a way to apply these rules for existing code as well? Currently I just see basic re-formatting such as indentation, placement of braces and imports.