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

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 44e2809b5fc Add IDEA code style schema (#19929)
44e2809b5fc is described below

commit 44e2809b5fc7d929b1ade9dc75ea88d0b405a5eb
Author: Hongsheng Zhong <[email protected]>
AuthorDate: Sun Aug 7 21:52:52 2022 +0800

    Add IDEA code style schema (#19929)
---
 CODE_OF_CONDUCT.md                                 |  2 +-
 .../content/contribute/code-conduct.cn.md          |  2 +-
 .../content/contribute/code-conduct.en.md          |  2 +-
 src/resources/code-style-idea.xml                  | 62 ++++++++++++++++++++++
 4 files changed, 65 insertions(+), 3 deletions(-)

diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index 7d95d22cad4..053e0352389 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -15,7 +15,7 @@ The following code of conduct is based on full compliance 
with [ASF CODE OF COND
  - Make sure the test coverage rate is not lower than the master branch.
  - Careful consideration for each `pull request`; Small and frequent `pull 
request` with complete unit function is welcomed.
  - Conform to `Contributor Covenant Code of Conduct` below.
- - If using IDEA,you can import the recommended 
[Settings](https://shardingsphere.apache.org/community/data/shardingsphere-settings.jar).
+ - If using IDEA,you can import the recommended 
[Settings](https://shardingsphere.apache.org/community/data/shardingsphere-settings.jar),
 or `src/resources/code-style-idea.xml`.
 
 ## Contributor Covenant Code of Conduct
 
diff --git a/docs/community/content/contribute/code-conduct.cn.md 
b/docs/community/content/contribute/code-conduct.cn.md
index f4479bca238..a4d54981eb7 100644
--- a/docs/community/content/contribute/code-conduct.cn.md
+++ b/docs/community/content/contribute/code-conduct.cn.md
@@ -22,7 +22,7 @@ chapter = true
  - 确保覆盖率不低于 master 分支。
  - 应尽量将设计精细化拆分;做到小幅度修改,多次数提交,但应保证提交的完整性。
  - 确保遵守编码规范。
- - 如果您使用 IDEA,可导入推荐的 
[Settings](https://shardingsphere.apache.org/community/data/shardingsphere-settings.jar)。
+ - 如果您使用 IDEA,可导入推荐的 
[Settings](https://shardingsphere.apache.org/community/data/shardingsphere-settings.jar),或者
 `src/resources/code-style-idea.xml`。
  - 通过 Spotless 统一代码风格,执行 `mvn spotless:apply` 格式化代码。
  
 ## 编码规范
diff --git a/docs/community/content/contribute/code-conduct.en.md 
b/docs/community/content/contribute/code-conduct.en.md
index cd38920ac6f..ee50021e0ac 100644
--- a/docs/community/content/contribute/code-conduct.en.md
+++ b/docs/community/content/contribute/code-conduct.en.md
@@ -19,7 +19,7 @@ The following code of conduct is based on full compliance 
with [ASF CODE OF COND
  - Make sure the test coverage rate is not lower than the master branch.
  - Careful consideration for each `pull request`; Small and frequent `pull 
request` with complete unit function is welcomed.
  - Conform to `Contributor Covenant Code of Conduct` below.
- - If using IDEA, you can import the recommended 
[Settings](https://shardingsphere.apache.org/community/data/shardingsphere-settings.jar).
+ - If using IDEA, you can import the recommended 
[Settings](https://shardingsphere.apache.org/community/data/shardingsphere-settings.jar),
 or `src/resources/code-style-idea.xml`.
  - Through the uniform code style of spotless, execute the `mvn 
spotless:apply` formatted code.
 
 ## Contributor Covenant Code of Conduct
diff --git a/src/resources/code-style-idea.xml 
b/src/resources/code-style-idea.xml
new file mode 100644
index 00000000000..6798aee2905
--- /dev/null
+++ b/src/resources/code-style-idea.xml
@@ -0,0 +1,62 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<code_scheme name="ShardingSphere" version="173">
+  <option name="LINE_SEPARATOR" value="&#xA;" />
+  <JavaCodeStyleSettings>
+    <option name="GENERATE_FINAL_LOCALS" value="true" />
+    <option name="GENERATE_FINAL_PARAMETERS" value="true" />
+    <option name="INSERT_INNER_CLASS_IMPORTS" value="true" />
+    <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
+    <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
+    <option name="JD_ALIGN_PARAM_COMMENTS" value="false" />
+    <option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false" />
+  </JavaCodeStyleSettings>
+  <codeStyleSettings language="JAVA">
+    <option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
+    <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
+    <indentOptions>
+      <option name="KEEP_INDENTS_ON_EMPTY_LINES" value="true" />
+    </indentOptions>
+    <arrangement>
+      <groups>
+        <group>
+          <type>GETTERS_AND_SETTERS</type>
+          <order>KEEP</order>
+        </group>
+        <group>
+          <type>OVERRIDDEN_METHODS</type>
+          <order>KEEP</order>
+        </group>
+        <group>
+          <type>DEPENDENT_METHODS</type>
+          <order>BREADTH_FIRST</order>
+        </group>
+      </groups>
+    </arrangement>
+  </codeStyleSettings>
+  <codeStyleSettings language="XML">
+    <indentOptions>
+      <option name="KEEP_INDENTS_ON_EMPTY_LINES" value="true" />
+    </indentOptions>
+  </codeStyleSettings>
+  <codeStyleSettings language="yaml">
+    <indentOptions>
+      <option name="KEEP_INDENTS_ON_EMPTY_LINES" value="true" />
+    </indentOptions>
+  </codeStyleSettings>
+</code_scheme>

Reply via email to