...
HTML code should be XHTML compliant. Groovy and Javascript files should follow the same convention conventions as Java files. For Javascript we suggest to use Aptana in Eclipse and to use the attachment provided (to import from Windows/Preferences/Aptana/Editors/Javascript/Formatting/Import)
In accordance with this standard we use 4 space indention rather than tabs, and set the tab size to 8 spaces to make code with tabs easier to pick out. Make sure no code contains tab characters.
For XML/HTML/FTL files we follow the standard XML/HTML/FTL format (TODO: add link to a reference here). XML/HTML/FTL files should use 2 spaces instead of 4, but there are still number of files using 4 space indention. So it's better to keep the indentation used in each file to avoid confusion when committing.
...
- Java -> Code Style -> Code Formatter -> Show... -> Java Conventions built-in -> Indentation, select Tab policy as "space only". Enter a new name for this profile and click "OK".
- Java -> Editor -> Typing, and check "Insert spaces for tab".
- Ant -> Editor -> Formatter, and uncheck "Use tab character instead of spaces".
- If you installed Colorer, Colorer Library Editor -> Uses spaces instead of tabs.
- If you installed XML Buddy, XMLBuddy -> Formatting -> Uses spaces instead of tabs.
- If you installed Oxygen, Oxygen -> Editor -> Format -> uncheck Indent with tabs, indent size 4.2 (beware for existing files with 4 spaces, always a trouble :/)
- Unfortunaltely neither of the 2 main FreeMarker pluggin plugins have similar functionnality yet. But there is a solution :
- Install AnyEdit plugin (http://andrei.gmxhome.de/eclipse/) and set its parameters in General -> Editors -> AnyEdit Tools. When using AnyEdit plugin, you should set it to
- Convert tab to space (it's by default in last versions)
- Add filters (like *.js, *.css) for files you don't want to auto-convert)
- Install AnyEdit plugin (http://andrei.gmxhome.de/eclipse/) and set its parameters in General -> Editors -> AnyEdit Tools. When using AnyEdit plugin, you should set it to
In Eclipse, for Java, you may use Ctrl+I to be sure of correct indentation.
...