This is an automated email from the ASF dual-hosted git repository.
jianglongtao 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 94e03b65bc6 Document : update code of conduct (#30426)
94e03b65bc6 is described below
commit 94e03b65bc6b14503f50629e27c6b4c2309184ce
Author: 孙念君 Nianjun Sun <[email protected]>
AuthorDate: Fri Mar 8 12:09:46 2024 +0800
Document : update code of conduct (#30426)
---
docs/community/content/involved/conduct/code.cn.md | 2 ++
docs/community/content/involved/conduct/code.en.md | 2 ++
2 files changed, 4 insertions(+)
diff --git a/docs/community/content/involved/conduct/code.cn.md
b/docs/community/content/involved/conduct/code.cn.md
index ef730c37551..6eea3412ba2 100644
--- a/docs/community/content/involved/conduct/code.cn.md
+++ b/docs/community/content/involved/conduct/code.cn.md
@@ -47,11 +47,13 @@ chapter = true
- map 中使用 `entry` 代替 `each`;
- 捕获的异常名称命名为 `ex` ;
- 捕获异常且不做任何事情,异常名称命名为 `ignored`。
+ - 方法入参名禁止使用 `result`、`each`、`entry`。
- 工具类名称命名为 `xxUtils`。
- 配置文件使用 `Spinal Case` 命名(一种使用 `-` 分割单词的特殊 `Snake Case`)。
- 需要注释解释的代码尽量提成小方法,用方法名称解释。
- `equals` 和 `==` 条件表达式中,常量在左,变量在右;大于小于等条件表达式中,变量在左,常量在右。
- 除了构造器入参与全局变量名称相同的赋值语句外,避免使用 `this` 修饰符。
+ - 局部变量不应设置为 final。
- 除了用于继承的抽象类之外,尽量将类设计为 `final`。
- 嵌套循环尽量提成方法。
- 成员变量定义顺序以及参数传递顺序在各个类和方法中保持一致。
diff --git a/docs/community/content/involved/conduct/code.en.md
b/docs/community/content/involved/conduct/code.en.md
index 2cbc19fb23d..3553e71ae98 100644
--- a/docs/community/content/involved/conduct/code.en.md
+++ b/docs/community/content/involved/conduct/code.en.md
@@ -44,11 +44,13 @@ The following code of conduct is based on full compliance
with [ASF CODE OF COND
- Replace `each` with `entry` in map;
- Exceptions when catch are named with `ex`;
- Exceptions when catch but do nothing are named with `ignored`.
+ - It is prohibited to use `result`, `each`, or `entry` as method parameter
names.
- Utility class should be named in the form of `xxUtils`.
- Name property files with `Spinal Case`(a variant of `Snake Case` which
uses hyphens `-` to separate words).
- Split codes that need to add notes with it into small methods, which are
explained with method names.
- Have constants on the left and variable on the right in `=` and `equals`
conditional expressions; Have variable on the left and constants on the right
in `greater than` and `less than` conditional expressions.
- Beside using same names as input parameters and global fields in assign
statement, avoid using `this` modifier.
+ - Local variables should not be set as final.
- Design class as `final` class except abstract class for extend.
- Make nested loop structures a new method.
- Order of members definition and parameters should be consistent during
classes and methods.