Skip to content

Contribution guide

Vojtech Polivka edited this page Apr 13, 2020 · 5 revisions

Contribution guide

Language

The project uses Kotlin unless using Java is absolutely necessary.

Code style

The project uses custom code style, currently only available for IntelliJ:

<code_scheme name="GraphQL Java Tools" version="173">
    <option name="AUTODETECT_INDENTS" value="false" />
    <option name="OTHER_INDENT_OPTIONS">
        <value>
            <option name="INDENT_SIZE" value="2" />
            <option name="TAB_SIZE" value="2" />
        </value>
    </option>
    <option name="RIGHT_MARGIN" value="1000" />
    <option name="FORMATTER_TAGS_ENABLED" value="true" />
    <option name="SOFT_MARGINS" value="160" />
    <JavaCodeStyleSettings>
        <option name="DO_NOT_WRAP_AFTER_SINGLE_ANNOTATION" value="true" />
        <option name="CLASS_NAMES_IN_JAVADOC" value="3" />
        <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="5" />
        <option name="JD_ADD_BLANK_AFTER_PARM_COMMENTS" value="true" />
        <option name="JD_ADD_BLANK_AFTER_RETURN" value="true" />
        <option name="JD_KEEP_INVALID_TAGS" value="false" />
        <option name="JD_KEEP_EMPTY_LINES" value="false" />
        <option name="JD_KEEP_EMPTY_PARAMETER" value="false" />
        <option name="JD_KEEP_EMPTY_EXCEPTION" value="false" />
        <option name="JD_KEEP_EMPTY_RETURN" value="false" />
    </JavaCodeStyleSettings>
    <codeStyleSettings language="GraphQL">
        <indentOptions>
            <option name="INDENT_SIZE" value="2" />
        </indentOptions>
    </codeStyleSettings>
    <codeStyleSettings language="JAVA">
        <option name="RIGHT_MARGIN" value="135" />
        <option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
        <option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
        <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
        <option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
        <option name="BLANK_LINES_AROUND_FIELD_IN_INTERFACE" value="1" />
        <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
        <option name="SPACE_WITHIN_BRACES" value="true" />
        <option name="METHOD_PARAMETERS_WRAP" value="5" />
        <option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
        <option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
        <option name="KEEP_SIMPLE_METHODS_IN_ONE_LINE" value="true" />
        <option name="KEEP_SIMPLE_LAMBDAS_IN_ONE_LINE" value="true" />
        <option name="KEEP_SIMPLE_CLASSES_IN_ONE_LINE" value="true" />
        <option name="WRAP_COMMENTS" value="true" />
        <option name="IF_BRACE_FORCE" value="3" />
        <option name="DOWHILE_BRACE_FORCE" value="3" />
        <option name="WHILE_BRACE_FORCE" value="3" />
        <option name="FOR_BRACE_FORCE" value="3" />
        <option name="WRAP_ON_TYPING" value="0" />
        <indentOptions>
            <option name="CONTINUATION_INDENT_SIZE" value="4" />
        </indentOptions>
    </codeStyleSettings>
    <codeStyleSettings language="kotlin">
        <option name="RIGHT_MARGIN" value="135" />
        <option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
        <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
        <option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
        <indentOptions>
            <option name="CONTINUATION_INDENT_SIZE" value="4" />
        </indentOptions>
    </codeStyleSettings>
</code_scheme>
Clone this wiki locally