Dies ist eine alte Version des Dokuments!
LU01b - Linting & Formatting
Formatting
Formatter sorgen dafür, dass der gemeinsame Code einheitlich formatiert wird. Oftmals besitzen IDE bereits eine Standard-Formattierung oder die Möglichkeit, Formatierungsregeln mit Entwicklern mit denselber IDE auszutauschen.
Beispiele von IDE-spezifischen Formatierungen:
- IntelliJ: Code Style XML unter
.idea/codeStyles/… - Visual Studio Code: Settings unter
.vscode/settings.json - Eclipse: Code Style Formatter: Eclipse Code Formatter XML
- Diverse IDE:
.editorconfig(aber nicht alle Regeln funktionieren aber bei allen IDE's)
| IntelliJ Project.xml | VS Code settings.json | Eclipse java-formatter.xml | .editorconfig | |
|---|---|---|---|---|
… </JavaCodeStyleSettings> <codeStyleSettings language="JAVA">
<!-- Tab size -->
<indentOptions>
<option name="INDENT_SIZE" value="4"/>
<option name="TAB_SIZE" value="4"/>
<option name="USE_TAB_CHARACTER" value="false"/>
</indentOptions>
<!-- New line at end of file -->
<option name="INSERT_FINAL_NEWLINE" value="true"/>
</codeStyleSettings>
...</WRAP>|test|test|test|
|