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 d05dfb96de8 Update code of conduct (#22086)
d05dfb96de8 is described below
commit d05dfb96de8d8dba0e2e43837271c9ba63c5eb72
Author: Hongsheng Zhong <[email protected]>
AuthorDate: Sat Nov 12 09:02:24 2022 +0800
Update code of conduct (#22086)
---
docs/community/content/involved/conduct/code.cn.md | 7 +++++--
docs/community/content/involved/conduct/code.en.md | 7 +++++--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/docs/community/content/involved/conduct/code.cn.md
b/docs/community/content/involved/conduct/code.cn.md
index 150a398c15d..d413dd2a4a6 100644
--- a/docs/community/content/involved/conduct/code.cn.md
+++ b/docs/community/content/involved/conduct/code.cn.md
@@ -18,7 +18,7 @@ chapter = true
## 代码提交行为规范
- - 确保构建流程中的各个步骤都成功完成,包括:Apache 协议文件头检查、Checkstyle 检查、编译、单元测试等。构建流程启动命令:`mvn -T
1C clean install` 或者 `./mvnw -T 1C clean install`。执行目录有 2
种选择,根据自己的熟悉程度做选择:1)对项目还不太熟悉,在项目根目录执行构建,所有模块都会执行构建,2)明确知道这次改动会影响到哪些模块,在这些模块执行构建,可以大大缩短构建时间。
+ - 确保构建流程中的各个步骤都成功完成,包括:Apache 协议文件头检查、Checkstyle 检查、编译、单元测试等。构建流程启动命令:`mvn -T
1C clean install`。执行目录有 2
种选择,根据自己的熟悉程度做选择:1)对项目还不太熟悉,在项目根目录执行构建,所有模块都会执行构建,2)明确知道这次改动会影响到哪些模块,在这些模块执行构建,可以大大缩短构建时间。
- 确保覆盖率不低于 master 分支。
- 应尽量将设计精细化拆分;做到小幅度修改,多次数提交,但应保证提交的完整性。
- 确保遵守编码规范。
@@ -30,13 +30,16 @@ chapter = true
- 使用 linux 换行符。
- 不应有无意义的空行。请提炼私有方法,代替方法体过长或代码段逻辑闭环而采用的空行间隔。
- 类、方法和变量的命名要做到顾名思义,类、方法名避免使用缩写,部分变量名可以使用缩写。
+ - 变量名 `arguments` 缩写为 `args`;
+ - 变量名 `parameters` 缩写为 `params`;
+ - 变量名 `environment` 缩写为 `env`;
- 变量名 `properties` 缩写为 `props`;
- 变量名 `configuration` 缩写为 `config`。
- 三位以内字符的专有名词缩写使用大写,超过三位字符的缩写采用驼峰形式。
-
三位以内字符的类和方法名称缩写的示例:DBDiscoveryExampleScenario、SQL92Lexer、XMLTransfer、MySQLAdminExecutorCreator;
- 三位以上字符的类和方法名称缩写的示例:JdbcUrlAppender、YamlAgentConfigurationSwapper;
- 变量应使用小驼峰形式:dbName、mysqlAuthenticationMethod、sqlStatement、mysqlConfig。
- - 返回值变量使用 `result` 命名;循环中使用 `each` 命名循环变量;map 中使用 `entry` 代替 `each`。
+ - 除了直接返回参数,返回变量使用 `result` 命名;循环中使用 `each` 命名循环变量;map 中使用 `entry` 代替 `each`。
- 捕获的异常名称命名为 `ex` ;捕获异常且不做任何事情,异常名称命名为 `ignored`。
- 配置文件使用 `Spinal Case` 命名(一种使用 `-` 分割单词的特殊 `Snake Case`)。
- 需要注释解释的代码尽量提成小方法,用方法名称解释。
diff --git a/docs/community/content/involved/conduct/code.en.md
b/docs/community/content/involved/conduct/code.en.md
index 4b3164e655c..546afe61cc8 100644
--- a/docs/community/content/involved/conduct/code.en.md
+++ b/docs/community/content/involved/conduct/code.en.md
@@ -15,7 +15,7 @@ The following code of conduct is based on full compliance
with [ASF CODE OF COND
## Contributor Covenant Submitting of Conduct
- - Make sure Maven build process success. Run `mvn -T 1C clean install` or
`./mvnw -T 1C clean install` command in shell to start Maven build process. On
which directory to run Maven build process, there are 2 alternatives, we could
select one of them: 1) if we're not familiar with Apache ShardingSphere, then
we could run it on project root directory, 2) if we know which modules will be
affected by the changes, then we could run it on these modules to save build
time.
+ - Make sure Maven build process success. Run `mvn -T 1C clean install`
command in shell to start Maven build process. On which directory to run Maven
build process, there are 2 alternatives, we could select one of them: 1) if
we're not familiar with Apache ShardingSphere, then we could run it on project
root directory, 2) if we know which modules will be affected by the changes,
then we could run it on these modules to save build time.
- 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.
@@ -27,13 +27,16 @@ The following code of conduct is based on full compliance
with [ASF CODE OF COND
- Use linux line separators.
- No meaningless blank lines. Please extract private methods to instead of
blank lines if too long method body or different logic code fragments.
- Use meaningful class, method and variable names, class and method name
avoid to use abbreviation. Some variables could use abbreviation.
+ - Variable `arguments` could abbreviate to `args`;
+ - Variable `parameters` could abbreviate to `params`;
+ - Variable `environment` could abbreviate to `env`;
- Variable `properties` could abbreviate to `props`;
- Variable `configuration` could abbreviate to `config`.
- Abbreviation composed less than 3 characters should be uppercase, more than
3 characters must use camel case naming rule.
- Example for abbreviation composed less than 3 characters:
DBDiscoveryExampleScenario, SQL92Lexer, XMLTransfer, MySQLAdminExecutorCreator;
- Example for abbreviation composed more than 3 characters:
JdbcUrlAppender, YamlAgentConfigurationSwapper;
- A variable composed of abbreviation should use lower camel case: dbName,
mysqlAuthenticationMethod, sqlStatement, mysqlConfig.
- - Return values are named with `result`; Variables in the loop structure are
named with `each`; Replace `each` with `entry` in map.
+ - Except return parameter as result, returning variable should be named with
`result`; Variables in the loop structure are named with `each`; Replace `each`
with `entry` in map.
- Exceptions when catch are named with `ex`; Exceptions when catch but do
nothing are named with `ignored`.
- 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.