File: code_format.md

package info (click to toggle)
triplea 1.9.0.0.7062-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 25,960 kB
  • sloc: java: 143,218; xml: 70,206; sh: 133; makefile: 9
file content (27 lines) | stat: -rw-r--r-- 1,357 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## IDE Code Format Setup

### Eclipse

Project preferences > Java > java format, import and select the eclipse format xml file.

- [https://github.com/triplea-game/triplea/blob/master/eclipse/format/triplea_java_eclipse_format_style.xml](https://github.com/triplea-game/triplea/blob/master/eclipse/format/triplea_java_eclipse_format_style.xml)
- [https://github.com/triplea-game/triplea/blob/master/eclipse/format/triplea_java_eclipse_cleanup.xml](https://github.com/triplea-game/triplea/blob/master/eclipse/format/triplea_java_eclipse_cleanup.xml)
- [https://github.com/triplea-game/triplea/blob/master/eclipse/format/triplea.importorder](https://github.com/triplea-game/triplea/blob/master/eclipse/format/triplea.importorder)

### IntelliJ
- Use plugin "Eclipse Code Formatter"


## Additional Notes

### Line Endings
- use LF line endings for java files, avoid using CRLF unless there is a pretty solid reason for it.

### Deviations from google formatter:
```
setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"
setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="false"
setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"
setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"
setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"
```