Skip to content

Latest commit

 

History

History
60 lines (43 loc) · 1.58 KB

Code-Formatting.md

File metadata and controls

60 lines (43 loc) · 1.58 KB

Code Formatting

Java Formatting

Java Code is formatted using the Google Java Style Guide with minimal customizations.

IntelliJ

  1. Open settings -> Editor -> Code Style
  2. Click the Gear icon next to the Scheme name
  3. Select Import Scheme -> Eclipse XML Profile
  4. Select the eclipse-java-google-style.xml file in the root of the repository

VS-Code

  1. Add the following to your settings.json.

    "java.format.settings.profile": "GoogleStyle",
    "java.format.settings.url": "eclipse-java-google-style.xml"

Customizations

  1. Allow method parameters to be on new lines

    <setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/>

    Example:

    return new PatientCommand.AddPatient(
                request.patient(),
                request.patientLocalId(),
                request.ssn(),
                request.dateOfBirth(),
                request.birthGender(),
                request.currentGender(),
                request.deceased(),
                request.deceasedTime(),
                request.maritalStatus(),
                request.ethnicity(),
                request.asOf(),
                request.comments(),
                request.createdBy(),
                request.createdAt());
  2. Increase max line length to 120

    <setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
    

Typescript Formatting

Typescript formatting is handled by the Prettier plugin.