You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hugegraph.apache.org by vg...@apache.org on 2024/02/27 04:55:28 UTC

(incubator-hugegraph) branch pd-store updated: chore: refine the hg-style.xml specification (#2457)

This is an automated email from the ASF dual-hosted git repository.

vgalaxies pushed a commit to branch pd-store
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph.git


The following commit(s) were added to refs/heads/pd-store by this push:
     new 198f7004a chore: refine the hg-style.xml specification (#2457)
198f7004a is described below

commit 198f7004ae3cf6f8b6a0bf9641a028070f24a204
Author: Hongjun Li <10...@users.noreply.github.com>
AuthorDate: Tue Feb 27 12:53:29 2024 +0800

    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`)
---
 .editorconfig       |  3 +++
 hugegraph-style.xml | 30 +++++++++++++++++++++++++++---
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/.editorconfig b/.editorconfig
index 740928132..67bf0e448 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -25,3 +25,6 @@ insert_final_newline = true
 [*.{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 8536d5154..84b4d2746 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>