HTHou commented on code in PR #46: URL: https://github.com/apache/tsfile/pull/46#discussion_r1520762299
########## docs/src/zh/Development/Development-Guide.md: ########## @@ -0,0 +1,452 @@ +<!-- + + 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. + +--> +# 开发指南 +## 开发约定 +### 代码格式化 (应该没有变化,昊男确认) +我们使用 [Spotless plugin](https://github.com/diffplug/spotless/tree/main/plugin-maven) 和 [google-java-format](https://github.com/google/google-java-format) 格式化 Java 代码。你可以通过以下步骤将 IDE 配置为在保存时自动应用格式以 IDEA 为例): +1.下载 [google-java-format-plugin v1.7.0.5](https://plugins.jetbrains.com/plugin/8527-google-java-format/versions/stable/83169), 安装到 IDEA(Preferences -> plugins -> search google-java-format),更详细的内容请查看[操作手册](https://github.com/google/google-java-format#intellij-android-studio-and-other-jetbrains-ides) +2.从磁盘安装 (Plugins -> little gear icon -> "Install plugin from disk" -> Navigate to downloaded zip file) +3.开启插件,并保持默认的 GOOGLE 格式 (2-space indents) +4.在 Spotless 没有升级到 18+之前,不要升级 google-java-format 插件 +5.安装 [Save Actions](https://plugins.jetbrains.com/plugin/7642-save-actions) 插件 , 并开启插件,打开 "Optimize imports" and "Reformat file" 选项。 +6.在“Save Actions”设置页面中,将 "File Path Inclusion" 设置为 .*.java”, 避免在编辑的其他文件时候发生意外的重新格式化 + +### 编码风格 (应该没有变化,昊男确认) +我们使用 [maven-checkstyle-plugin](https://checkstyle.sourceforge.io/config_filefilters.html)来保证所有的 Java 代码风格都遵循在项目根目录下的 [checkstyle.xml](https://github.com/apache/iotdb/blob/master/checkstyle.xml) 文件中定义的规则集. + +您可以从该文件中查阅到所有的代码风格要求。当开发完成后,您可以使用 `mvn validate` 命令来检查您的代码是否符合代码风格的要求。 + +另外, 当您在集成开发环境开发时,可能会因为环境的默认代码风格配置导致和本项目的风格规则冲突。 + +在 IDEA 中,您可以通过如下步骤解决风格规则不一致的问题。 +- 禁用通配符引用 + - 跳转至 Java 代码风格配置页面 (Preferences... -> 编辑器 -> 代码风格 -> Java)。 + - 切换到“导入”标签。 + - 在“常规”部分,启用“使用单个类导入”选项。 + - 将“将 import 与‘*’搭配使用的类计数”改成 999 或者一个比较大的值。 + - 将“将静态 import 与‘*’搭配使用的名称计数”改成 999 或者一个比较大的值。 + +## 贡献方式 +### 参与投票 (问昊男投票方式) +- 1.给发布版本投票 + * 非中文用户,请阅读 https://cwiki.apache.org/confluence/display/IOTDB/Validating+a+staged+Release +- 2.下载投票的版本/rc下所有内容 + * https://dist.apache.org/repos/dist/dev/iotdb/ + +- 3.导入发布经理的公钥 + + * https://dist.apache.org/repos/dist/dev/iotdb/KEYS + + * 最下边有 Release Manager (RM) 的公钥 + + * 安装 gpg2 + Review Comment: ```suggestion ### 参与投票 - 1.给发布版本投票 * 非中文用户,请阅读 https://cwiki.apache.org/confluence/display/IOTDB/Validating+a+staged+Release - 2.下载投票的版本/rc下所有内容 * https://dist.apache.org/repos/dist/dev/tsfile/ - 3.导入发布经理的公钥 * https://dist.apache.org/repos/dist/dev/tsfile/KEYS * 最下边有 Release Manager (RM) 的公钥 * 安装 gpg2 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
