chore: refine the hg-style.xml specification (#2457)
- Change the maximum wrap text length for XML to 120 (via `hg-style.xml`)
- Add a blank line between method definitions, inner class definitions, and static code blocks (via `hg-style.xml`)
- Add `<p>` tags to Javadoc blank lines (via `hg-style.xml`)
- `.xml` file leaves a blank line at the end (via `.editorconfig`)
- Class declaration requires a blank line before and after each line (via `hg-style.xml`)
- Javadoc line comment not in line (via `hg-style.xml`)
- `.properties` file leaves empty lines (via `hg-style.xml`)
- `.yaml` file braces `{}`, brackets `[]` remove spaces (via `hg-style.xml`)
diff --git a/.editorconfig b/.editorconfig
index 7409281..67bf0e4 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -25,3 +25,6 @@
[*.{java,xml,py}]
indent_style = space
indent_size = 4
+
+[*.{java,xml}]
+continuation_indent_size = 8
diff --git a/hugegraph-style.xml b/hugegraph-style.xml
index 8536d51..84b4d27 100644
--- a/hugegraph-style.xml
+++ b/hugegraph-style.xml
@@ -22,6 +22,8 @@
<option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="true" />
<option name="SOFT_MARGINS" value="100" />
<JavaCodeStyleSettings>
+ <option name="JD_P_AT_EMPTY_LINES" value="true" />
+ <option name="JD_DO_NOT_WRAP_ONE_LINE_COMMENTS" value="true" />
<option name="ANNOTATION_PARAMETER_WRAP" value="1" />
<option name="ALIGN_MULTILINE_ANNOTATION_PARAMETERS" value="true" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="100" />
@@ -42,9 +44,6 @@
</value>
</option>
</JavaCodeStyleSettings>
- <XML>
- <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
- </XML>
<codeStyleSettings language="JAVA">
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="ALIGN_MULTILINE_CHAINED_METHODS" value="true" />
@@ -74,8 +73,33 @@
<option name="WRAP_LONG_LINES" value="true" />
<option name="PARAMETER_ANNOTATION_WRAP" value="1" />
<option name="ENUM_CONSTANTS_WRAP" value="2" />
+ <option name="WRAP_ON_TYPING" value="1" />
+ <option name="SOFT_MARGINS" value="100" />
+ <option name="RIGHT_MARGIN" value="100" />
+ <option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
+ <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
+ <option name="KEEP_BLANK_LINES_BETWEEN_PACKAGE_DECLARATION_AND_HEADER" value="1" />
+ <option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
+ <option name="BLANK_LINES_AROUND_CLASS" value="1" />
<indentOptions>
<option name="SMART_TABS" value="true" />
</indentOptions>
</codeStyleSettings>
+ <codeStyleSettings language="XML">
+ <option name="RIGHT_MARGIN" value="120" />
+ <option name="WRAP_ON_TYPING" value="1" />
+ <option name="SOFT_MARGINS" value="120" />
+ </codeStyleSettings>
+ <XML>
+ <option name="XML_TEXT_WRAP" value="0" />
+ <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
+ <option name="XML_SPACE_INSIDE_EMPTY_TAG" value="true" />
+ </XML>
+ <Properties>
+ <option name="KEEP_BLANK_LINES" value="true" />
+ </Properties>
+ <codeStyleSettings language="yaml">
+ <option name="SPACE_WITHIN_BRACKETS" value="false" />
+ <option name="SPACE_WITHIN_BRACES" value="false" />
+ </codeStyleSettings>
</code_scheme>