You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by li...@apache.org on 2020/08/14 00:03:10 UTC
[incubator-dolphinscheduler-website] branch master updated:
[Feature][docs] Add checkstyle configuration lessons
This is an automated email from the ASF dual-hosted git repository.
lidongdai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler-website.git
The following commit(s) were added to refs/heads/master by this push:
new 3d9f8f6 [Feature][docs] Add checkstyle configuration lessons
new 037eb92 Merge pull request #166 from yangyichao-mango/feature-checkstyle
3d9f8f6 is described below
commit 3d9f8f6f627d707f420d0c78d29eee19db59bbe2
Author: Yichao Yang <10...@qq.com>
AuthorDate: Thu Aug 13 22:35:31 2020 +0800
[Feature][docs] Add checkstyle configuration lessons
---
docs/en-us/development/pull-request.md | 28 ++++++++++++++++++++++++++++
docs/zh-cn/development/pull-request.md | 28 ++++++++++++++++++++++++++++
img/checkstyle-idea.png | Bin 0 -> 534957 bytes
img/code-style-idea.png | Bin 0 -> 527671 bytes
4 files changed, 56 insertions(+)
diff --git a/docs/en-us/development/pull-request.md b/docs/en-us/development/pull-request.md
index 23265af..61c8d72 100755
--- a/docs/en-us/development/pull-request.md
+++ b/docs/en-us/development/pull-request.md
@@ -54,6 +54,34 @@ The corresponding relationship between `Pull Request Type` and `Issue Type` is a
Please refer to the commit message section.
+### Pull Request Code Style
+
+[Checkstyle](https://checkstyle.sourceforge.io/) is a development tool to help programmers write Java code that adheres to a coding standard. It automates the process of checking Java code to spare humans of this boring (but important) task. This makes it ideal for projects that want to enforce a coding standard.
+
+How to configure checkstyle and code style in dolphin scheduler:
+
+1.checkstyle and code-style configuration files
+
+checkstyle: https://github.com/apache/incubator-dolphinscheduler/blob/dev/style/checkstyle.xml
+
+code-style: https://github.com/apache/incubator-dolphinscheduler/blob/dev/style/intellij-java-code-style.xml
+
+2.checkstyle configuration
+
+ <p align="center">
+ <img src="/img/checkstyle-idea.png" alt="checkstyle idea configuration" />
+ </p>
+
+3.code-style configuration
+
+ <p align="center">
+ <img src="/img/code-style-idea.png" alt="code style idea configuration" />
+ </p>
+
+4.How to use checkstyle and code style
+
+After configuration, before submitting a Pull Request, the checkstyle tool will automatically help you format code and import order in the changed code file when you use `Ctrl+L`.
+
### Question
- How to deal with one Pull Request to many Issues scenario.
diff --git a/docs/zh-cn/development/pull-request.md b/docs/zh-cn/development/pull-request.md
index 67da68a..092f0a6 100755
--- a/docs/zh-cn/development/pull-request.md
+++ b/docs/zh-cn/development/pull-request.md
@@ -60,6 +60,34 @@ waste time。
请参阅到 commit message 篇。
+### Pull Request Code Style
+
+checkstyle [参考](https://checkstyle.sourceforge.io/)是一种帮助开发者编写遵循编码规范的 Java 代码开发工具。它可以自动化检查 Java 代码的方法以及格式,使得开发者不用再做这项无聊(但很重要)的任务。它非常适合于希望实施编码标准的项目。
+
+在 DolphinScheduler 中配置 checkstyle 和 code-style 的方式:
+
+1.checkstyle 和 code-style 配置文件
+
+checkstyle: https://github.com/apache/incubator-dolphinscheduler/blob/dev/style/checkstyle.xml
+
+code-style: https://github.com/apache/incubator-dolphinscheduler/blob/dev/style/intellij-java-code-style.xml
+
+2.checkstyle 配置过程
+
+ <p align="center">
+ <img src="/img/checkstyle-idea.png" alt="checkstyle idea 配置方式" />
+ </p>
+
+3.code-style 配置过程
+
+ <p align="center">
+ <img src="/img/code-style-idea.png" alt="code style idea 配置方式" />
+ </p>
+
+4.怎样使用 checkstyle 和 code-style
+
+当你配置完成后,在提交 Pull Request 前,在改动过后的代码文件中 `Ctrl+L`,checkstyle 工具就会自动帮你 format code 和 import 顺序。
+
### 相关问题
- 怎样处理一个 Pull Request 对应多个 Issue 的场景。
diff --git a/img/checkstyle-idea.png b/img/checkstyle-idea.png
new file mode 100644
index 0000000..1b4ed25
Binary files /dev/null and b/img/checkstyle-idea.png differ
diff --git a/img/code-style-idea.png b/img/code-style-idea.png
new file mode 100644
index 0000000..ddc6f32
Binary files /dev/null and b/img/code-style-idea.png differ