Importing APEX Code Style in Eclipse
For Eclipse there are 2 configuration files
- .settings/apex-style.xml : this contains Java formatter settings.
- .settings/apex-importorder.importorder : this specifies the accepted import order for Apex projects.
##To import Apex format style
- On the main menu, choose Eclipse | Preferences.
- Go to Java | Code Style | Formatter and click on ‘Import’.
- In the Import Profile dialog box that opens select the
.settings/apex-style.xml
. - Apply the changes.
##To import Apex import order
- On the main menu, choose Eclipse | Preferences.
- Go to Java | Code Style | Organize Imports and click on ‘Import’.
- In the Load Import Order from File dialog box that opens select
.settings/apex-importorder.importorder
. - Apply the changes.
##Trailing whitespace Apex checkstyle enforces no trailing whitespace. You can have Eclipse automatically remove trailing whitespace: http://stackoverflow.com/questions/1043433/how-to-auto-remove-trailing-whitespace-in-eclipse/2618521#2618521