You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2022/11/25 11:05:16 UTC

[shardingsphere] branch master updated: Update code conduct (#22416)

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

panjuan 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 4f58466dd4e Update code conduct (#22416)
4f58466dd4e is described below

commit 4f58466dd4e7798eadba70eebeadf3652a9bef97
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Fri Nov 25 19:05:09 2022 +0800

    Update code conduct (#22416)
---
 docs/community/content/involved/conduct/code.cn.md | 5 ++++-
 docs/community/content/involved/conduct/code.en.md | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/docs/community/content/involved/conduct/code.cn.md b/docs/community/content/involved/conduct/code.cn.md
index 900dd4c2161..b28d4d53a3a 100644
--- a/docs/community/content/involved/conduct/code.cn.md
+++ b/docs/community/content/involved/conduct/code.cn.md
@@ -80,7 +80,10 @@ chapter = true
  - 每个测试用例需精确断言,尽量不使用 `not`、`containsString` 断言。
  - 准备环境的代码和测试代码分离。
  - 只有 Mockito,junit `Assert`,hamcrest `CoreMatchers` 和 `MatcherAssert` 相关可以使用 static import。
- - 数据断言方法的使用:对于 boolean 类型的断言应使用 `assertTrue` 和 `assertFalse`,断言是否为空应使用 `assertNull` 和 `assertNotNull`,其他场景应使用 `assertThat`。
+ - 数据断言规范应遵循:
+    - 布尔类型断言应使用 `assertTrue` 和 `assertFalse`;
+    - 空值断言应使用 `assertNull` 和 `assertNotNull`;
+    - 其他类型应使用 `assertThat`。
  - 测试用例的真实值应名为为 actual XXX,期望值应命名为 expected XXX。
  - 测试类和 `@Test` 标注的方法无需 javadoc。
  - 使用 Mockito `mockStatic` 和 `mockConstruction` 方法必须搭配 try-with-resource 或在清理方法中关闭,避免泄漏。
diff --git a/docs/community/content/involved/conduct/code.en.md b/docs/community/content/involved/conduct/code.en.md
index 3fed4a823f1..2cac4aac191 100644
--- a/docs/community/content/involved/conduct/code.en.md
+++ b/docs/community/content/involved/conduct/code.en.md
@@ -79,6 +79,10 @@ The following code of conduct is based on full compliance with [ASF CODE OF COND
  - Environment preparation codes should be separate from test codes.
  - Only those that relate to `Mockito`, junit `Assert`, hamcrest `CoreMatchers` and `MatcherAssert` can use static import.
  - Usage of assertion methods: for boolean type asserts, `assertTrue` and `assertFalse` should be used, `assertNull` and `assertNotNull` should be used to assert whether the assertion is null, and `assertThat` should be used for other scenarios.
+ - Usage of assertion methods:
+   - Use `assertTrue` and `assertFalse` for boolean value;
+   - Use `assertNull` and `assertNotNull` for null value;
+   - Use `assertThat` for other values.
  - Actual values of test cases should be named `actualXXX`, expected values `expectedXXX`.
  - Class for test case and `@Test` annotation do not need javadoc.
  - Mockito `mockStatic` and `mockConstruction` methods must be used with try-with-resource or closed in the teardown method to avoid leaks.