|
1 | | -# 为 FastExcel 做贡献 |
| 1 | +# Contribution Guidelines |
2 | 2 |
|
3 | | -FastExcel 欢迎社区的每一位用户和开发者成为贡献者。无论是报告问题、改进文档、提交代码,还是提供技术支持,您的参与都将帮助 FastExcel 变得更好。 |
| 3 | +Welcome every user and developer in the community to become contributors. Whether it's reporting issues, improving |
| 4 | +documentation, submitting code, or providing technical support, your participation will help make the Apache Fesod ( |
| 5 | +Incubating) better. |
4 | 6 |
|
5 | 7 | --- |
6 | 8 |
|
7 | | -## 报告问题 |
| 9 | +## Contribution Directions |
8 | 10 |
|
9 | | -我们鼓励用户在使用 FastExcel 的过程中随时提供反馈。您可以通过 [NEW ISSUE](https://github.com/fast-excel/fastexcel/issues/new/choose) 提交问题。 |
| 11 | +There are many ways to contribute to Apache Fesod (Incubating): |
10 | 12 |
|
11 | | -### 高质量问题报告 |
| 13 | +- Fix typos |
| 14 | +- Fix bugs |
| 15 | +- Remove redundant code |
| 16 | +- Add test cases |
| 17 | +- Enhance functionality |
| 18 | +- Add comments to improve code readability |
| 19 | +- Optimize code structure |
| 20 | +- Improve or refine documentation |
12 | 21 |
|
13 | | -为了提高沟通效率,请在提交问题前: |
| 22 | +**Principle**: |
14 | 23 |
|
15 | | -1. **搜索现有问题**:检查您的问题是否已被报告。如果存在,请直接在现有问题下评论补充详细信息,而不是创建新问题。 |
16 | | -2. **使用问题模板**:问题模板位于 [ISSUE TEMPLATE](./.github/ISSUE_TEMPLATE),请按照模板要求填写,以确保问题描述准确且完整。 |
17 | | - |
18 | | -以下情况适合提交新问题: |
19 | | - |
20 | | -- Bug 报告 |
21 | | -- 新功能需求 |
22 | | -- 性能问题 |
23 | | -- 功能提案或设计 |
24 | | -- 文档改进 |
25 | | -- 测试覆盖率优化 |
26 | | -- 需要技术支持 |
27 | | -- 其他与项目相关的问题 |
28 | | - |
29 | | -> **注意**:请勿在问题中包含敏感信息,如密码、密钥、服务器地址或私人数据。 |
| 24 | +- Any pull request that contributes to the improvement of the project should be encouraged. |
| 25 | +- Before contributing a new feature, please propose and discuss it in an `issue` or `discussion`. We will not merge |
| 26 | + features that have not been discussed and confirmed. |
30 | 27 |
|
31 | 28 | --- |
32 | 29 |
|
33 | | -## 贡献代码与文档 |
| 30 | +## Contributing Code |
34 | 31 |
|
35 | | -所有对 FastExcel 的改进均可通过 Pull Request (PR) 实现。无论是修复 Bug、优化代码、增强功能,还是改进文档,都非常欢迎! |
| 32 | +All improvements can be implemented through Pull Request (PR). Before submitting a Pull Request, please familiarise |
| 33 | +yourself with the following guidelines: |
36 | 34 |
|
37 | | -### 您可以贡献的方向 |
| 35 | +### Workspace Preparation |
38 | 36 |
|
39 | | -- 修复错别字 |
40 | | -- 修复 Bug |
41 | | -- 删除冗余代码 |
42 | | -- 添加测试用例 |
43 | | -- 增强功能 |
44 | | -- 添加注释以提升代码可读性 |
45 | | -- 优化代码结构 |
46 | | -- 改进或完善文档 |
| 37 | +To develop Apache Fesod (Incubating), you need **Maven 3.9 or above** and **JDK (Java Development Kit) 17 or above**. |
| 38 | +However, you must |
| 39 | +use **Java 1.8** compatible language features during compilation to ensure Apache Fesod (Incubating) can run in |
| 40 | +environments with Java |
| 41 | +1.8 or above. |
47 | 42 |
|
48 | | -**原则**:**任何有助于项目改进的 PR 都值得鼓励!** |
| 43 | +> You can use tools such as [SDKMAN](https://sdkman.io/) to configure multiple versions of the Java toolchain. |
49 | 44 |
|
50 | | -在提交 PR 前,请熟悉以下指南: |
| 45 | +### Fork the repository |
51 | 46 |
|
52 | | -1. [工作区准备](#工作区准备) |
53 | | -2. [分支定义](#分支定义) |
54 | | -3. [提交规则](#提交规则) |
55 | | -4. [PR 说明](#PR-说明) |
| 47 | +Ensure that you have registered a GitHub account and follow the steps below to configure your local development |
| 48 | +environment: |
56 | 49 |
|
57 | | ---- |
| 50 | +**Fork the repository**: Click the `Fork` button on the Apache Fesod ( |
| 51 | +Incubating) [GitHub page](https://github.com/apache/fesod) to copy the project to your GitHub account. |
58 | 52 |
|
59 | | -### 工作区准备 |
| 53 | +```bash |
| 54 | +https://github.com/<your-username>/fesod |
| 55 | +``` |
60 | 56 |
|
61 | | -开发 FastExcel 需要 **3.8.1及以上版本的Maven** 和 **17及以上版本的JDK (Java Development Kit)** 。目前,开发环境推荐 **3.9.0** 及以上版本的Maven和 **21** 及以上的版本Java,但在编译过程中必须使用 **Java 1.8** 兼容的语言特性,保证 FastExcel 能在 Java 1.8 及以上版本环境中运行。 |
| 57 | +**Clone Repository**: Run the following command to clone the forked project to your local machine: |
62 | 58 |
|
63 | | -您可以使用 [SDKMAN](https://sdkman.io/) 等工具配置多版本的 Java 工具链。如果使用 IntelliJ IDEA 开发,可以设置项目 [Language Level](https://www.jetbrains.com/help/idea/project-settings-and-structure.html#language-level) 为 8 以确保后向兼容。 |
| 59 | +```bash |
| 60 | +git clone [email protected]: <your-username >/fesod.git |
| 61 | +``` |
64 | 62 |
|
65 | | -确保您已注册 GitHub 账号,并按照以下步骤完成本地开发环境配置: |
| 63 | +**Set Upstream Repository**: Set the official repository as `upstream` for easy synchronization of updates: |
66 | 64 |
|
67 | | -1. **Fork 仓库**:在 FastExcel 的 [GitHub 页面](https://github.com/fast-excel/fastexcel) 点击 `Fork` 按钮,将项目复制到您的 GitHub 账户下,例如:`https://github.com/<your-username>/fastexcel`。 |
68 | | -2. **克隆代码库**:运行以下命令将 Fork 的项目克隆到本地: |
69 | | - ```bash |
70 | | - git clone [email protected]: <your-username >/fastexcel.git |
71 | | - ``` |
72 | | -3. **设置上游仓库**:将官方仓库设置为 `upstream`,方便同步更新: |
73 | | - ```bash |
74 | | - git remote add upstream [email protected]:fast-excel/fastexcel.git |
75 | | - git remote set-url --push upstream no-pushing |
76 | | - ``` |
77 | | - 运行 `git remote -v` 可检查配置是否正确。 |
| 65 | +```bash |
| 66 | +git remote add upstream [email protected]:apahce/fesod.git |
| 67 | +git remote set-url --push upstream no-pushing |
| 68 | +``` |
78 | 69 |
|
79 | | ---- |
| 70 | +Running `git remote -v` can verify if the configuration is correct. |
80 | 71 |
|
81 | | -### 分支定义 |
| 72 | +### Branch definition |
82 | 73 |
|
83 | | -在 FastExcel 中,所有贡献应基于 `main` 开发分支。此外,还有以下分支类型: |
| 74 | +In Apache Fesod (Incubating), all contributions should be based on the `main` development branch. Additionally, there |
| 75 | +are the following branch types: |
84 | 76 |
|
85 | | -- **release 分支**:用于版本发布(如 `0.6.0`, `0.6.1`)。 |
86 | | -- **feature 分支**:用于开发较大的功能。 |
87 | | -- **hotfix 分支**:用于修复重要 Bug。 |
| 77 | +- **release branches**: Used for version releases (e.g., `1.1.0`, `1.1.1`). |
| 78 | +- **feature branches**: Used for developing major features. |
| 79 | +- **hotfix branches**: Used for fixing critical bugs. |
88 | 80 |
|
89 | | -提交 PR 时,请确保变更基于 `main` 分支。 |
| 81 | +When submitting a PR, please ensure that the changes are based on the `main` branch. |
90 | 82 |
|
91 | | ---- |
| 83 | +### Commit Rules |
92 | 84 |
|
93 | | -### 提交规则 |
| 85 | +#### Commit Message |
94 | 86 |
|
95 | | -#### 提交信息 |
| 87 | +Please ensure that commit messages are clear and descriptive, use **English**, and do not exceed 100 characters. |
96 | 88 |
|
97 | | -请确保提交消息清晰且具有描述性,遵循以下格式: |
| 89 | +The following types of commit messages are allowed and must follow the following format: |
98 | 90 |
|
99 | | -- **docs**: 更新文档,例如 `docs: 更新 PR 提交指南`。 |
100 | | -- **feature**: 新功能,例如 `feature: 支持 并发写入`。 |
101 | | -- **bugfix**: 修复 Bug,例如 `bugfix: 修复空指针异常`。 |
102 | | -- **refactor**: 重构代码,例如 `refactor: 优化数据处理逻辑`。 |
103 | | -- **test**: 增加或改进测试,例如 `test: 添加单元测试`。 |
| 91 | +- **docs**: Update documentation, e.g., `docs: update README.md` |
| 92 | +- **feature/feat**: New features, e.g., `feature: support for xxx` |
| 93 | +- **bugfix/fix**: Bug fixes, e.g., `fix: fix NPE in the A class` |
| 94 | +- **refactor**: Code refactoring (no functional changes), e.g., `refactor: optimise data processing logic` |
| 95 | +- **style**: Code formatting, e.g., `style: update code style` |
| 96 | +- **test**: Adding or improving tests, e.g., `test: add new test cases` |
| 97 | +- **chore**: Changes to the build process or auxiliary tools, e.g., `chore: improve issue template` |
| 98 | +- **dependency**: Modifications to third-party dependency libraries, e.g., `dependency: upgrade poi version to 5.4.1` |
104 | 99 |
|
105 | | -不建议使用模糊的提交信息,如: |
| 100 | +Avoid using vague commit messages like: |
106 | 101 |
|
107 | | -- ~~修复问题~~ |
108 | | -- ~~更新代码~~ |
| 102 | +- ~~fixed issue~~ |
| 103 | +- ~~update code~~ |
109 | 104 |
|
110 | | -如果需要帮助,请参考 [如何编写 Git 提交消息](http://chris.beams.io/posts/git-commit/)。 |
| 105 | +For assistance, refer to [How to Write a Git Commit Message](http://chris.beams.io/posts/git-commit/). |
111 | 106 |
|
112 | | -#### 提交内容 |
| 107 | +#### Commit Content |
113 | 108 |
|
114 | | -一次提交应包含完整且可审查的更改,确保: |
| 109 | +Each commit should contain complete and reviewable changes, ensuring: |
115 | 110 |
|
116 | | -- 避免提交过于庞大的改动。 |
117 | | -- 每次提交内容独立且可通过 CI 测试。 |
| 111 | +- Avoid committing overly large changes. |
| 112 | +- Each commit content is independent and can pass CI tests. |
118 | 113 |
|
119 | | -另外,请确保提交时配置正确的 Git 用户信息: |
| 114 | +Also, ensure the correct Git user information is configured when committing: |
120 | 115 |
|
121 | 116 | ```bash |
122 | 117 | git config --get user.name |
123 | 118 | git config --get user.email |
124 | 119 | ``` |
125 | 120 |
|
| 121 | +### PR Description |
| 122 | + |
| 123 | +To help reviewers quickly understand the content and purpose of the PR, use |
| 124 | +the [pull_request_template](https://github.com/apache/fesod/blob/main/.github/pull_request_template.md). A |
| 125 | +detailed description greatly improves code review efficiency. |
| 126 | + |
126 | 127 | --- |
127 | 128 |
|
128 | | -### PR 说明 |
| 129 | +## Contribution of Test Cases |
129 | 130 |
|
130 | | -为了帮助审阅者快速了解 PR 的内容和目的,请使用 [PR 模板](.github/pull_request_template.md)。详细的描述将极大提高代码审阅效率。 |
| 131 | +Any contribution of test cases is encouraged, especially unit tests. It is recommended to create `XXXTest.java` files in |
| 132 | +the corresponding module's `test` directory, preferably using the `JUnit5` framework. |
131 | 133 |
|
132 | 134 | --- |
133 | 135 |
|
134 | | -## 测试用例贡献 |
| 136 | +## Contribution Document |
| 137 | + |
| 138 | +Documentation is an important component of the Apache Fesod (Incubating) official website and serves as a vital bridge |
| 139 | +between the |
| 140 | +project and the community.The Apache Fesod (Incubating) official website is built |
| 141 | +using [Docusaurus](https://docusaurus.io/), and the |
| 142 | +documentation is maintained in the [website](https://github.com/apache/fesod/tree/main/website) directory. |
| 143 | + |
| 144 | +### Requirements |
| 145 | + |
| 146 | +- [Node.js](https://nodejs.org/en/download/) version 18.0 or above (which can be checked by running `node -v`). You can |
| 147 | + use [nvm](https://github.com/nvm-sh/nvm) for managing multiple Node versions on a single machine installed. |
| 148 | +- When installing Node.js, you are recommended to check all checkboxes related to dependencies. |
| 149 | + |
| 150 | +### Directory Structure Description |
| 151 | + |
| 152 | +Docusaurus supports I18n. The main documentation directory structure that needs to be maintained is as follows: |
| 153 | + |
| 154 | +```bash |
| 155 | +. |
| 156 | +├── community # Community(English) |
| 157 | +├── docs # Documentation(English) |
| 158 | +└── i18n # I18n |
| 159 | + └── zh-cn |
| 160 | + ├── docusaurus-plugin-content-docs |
| 161 | + │ └── current # Documentation(Simplified Chinese) |
| 162 | + └── docusaurus-plugin-content-docs-community |
| 163 | + └── current # Community(Simplified Chinese) |
| 164 | +``` |
| 165 | + |
| 166 | +The directory structure for single-language documents is as follows: |
| 167 | + |
| 168 | +```bash |
| 169 | +. |
| 170 | +├── quickstart # 1. Quick Start |
| 171 | +├── read # 2. Read |
| 172 | +├── write # 3. Write |
| 173 | +├── fill # 4. Fill |
| 174 | +├── community # 5. Community |
| 175 | +└── help # 6. FAQ |
| 176 | +``` |
| 177 | + |
| 178 | +### Documentation Writing Guidelines |
| 179 | + |
| 180 | +- Use file paths with the `.md` extension |
| 181 | + |
| 182 | +```markdown |
| 183 | +[Example](docs/quickstart/example.md) |
| 184 | +``` |
| 185 | + |
| 186 | +- Use paths relative to the docs/ directory |
135 | 187 |
|
136 | | -任何测试用例的贡献都值得鼓励,尤其是单元测试。建议在对应模块的 `test` 目录中创建 `XXXTest.java` 文件,推荐使用 JUnit5 框架。 |
| 188 | +```markdown |
| 189 | +[Example](docs/quickstart/example.md) |
| 190 | +``` |
| 191 | + |
| 192 | +- Image files must be stored in the `static/img` directory and referenced using relative directory paths. |
| 193 | + |
| 194 | +```markdown |
| 195 | +[img](/img/docs/fill/listFill_file.png) |
| 196 | +``` |
| 197 | + |
| 198 | +### Preview and generate static files |
| 199 | + |
| 200 | +Enter the `website` directory and execute the command |
| 201 | + |
| 202 | +#### Installation |
| 203 | + |
| 204 | +```bash |
| 205 | +yarn install |
| 206 | +``` |
| 207 | + |
| 208 | +#### Local Development |
| 209 | + |
| 210 | +```bash |
| 211 | +# English |
| 212 | +yarn start |
| 213 | + |
| 214 | +# Simplified Chinese |
| 215 | +yarn start --locale zh-cn |
| 216 | +``` |
| 217 | + |
| 218 | +This command starts a local development server and opens up a browser window. Most changes are reflected live without |
| 219 | +having to restart the server. |
| 220 | + |
| 221 | +> Only one language version can be run at a time. |
| 222 | +
|
| 223 | +#### Build(Optional) |
| 224 | + |
| 225 | +```bash |
| 226 | +yarn build |
| 227 | +``` |
| 228 | + |
| 229 | +This command generates static content into the `build` directory and can be served using any static contents hosting |
| 230 | +service. |
| 231 | + |
| 232 | +### Document Format Inspection |
| 233 | + |
| 234 | +Apache Fesod (Incubating) uses [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2) to check document |
| 235 | +formatting. After writing the relevant Markdown articles, you can run the following command locally to pre-check whether |
| 236 | +the Markdown formatting meets the requirements: |
| 237 | + |
| 238 | +```bash |
| 239 | +cd website && yarn |
| 240 | + |
| 241 | +yarn md-lint |
| 242 | + |
| 243 | +# If the documentation is wrong, you can use the following command to attempt an automatic repair. |
| 244 | +yarn md-lint-fix |
| 245 | +``` |
| 246 | + |
| 247 | +- For formatting rules for Markdown articles you can refer |
| 248 | + to: [Markdown-lint-rules](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md) |
| 249 | +- Markdown format configuration file in the |
| 250 | + project: [.markdownlint-cli2.jsonc](https://github.com/apache/fesod/blob/main/website/.markdownlint-cli2.jsonc) |
137 | 251 |
|
138 | 252 | --- |
139 | 253 |
|
140 | | -## 其他参与方式 |
| 254 | +## Other Ways to Contribute |
141 | 255 |
|
142 | | -除了直接贡献代码,以下方式同样是对 FastExcel 的宝贵支持: |
| 256 | +Apart from directly contributing code, the following ways are also valuable support for Apache Fesod (Incubating): |
143 | 257 |
|
144 | | -- 回答其他用户的问题。 |
145 | | -- 帮助审阅他人的 PR。 |
146 | | -- 提出改进建议。 |
147 | | -- 撰写技术博客,宣传 FastExcel。 |
148 | | -- 在社区中分享项目相关知识。 |
| 258 | +- Answering other users' questions. |
| 259 | +- Assisting in reviewing others' PRs. |
| 260 | +- Providing improvement suggestions. |
| 261 | +- Writing technical blogs to promote. |
| 262 | +- Sharing project-related knowledge in the community. |
149 | 263 |
|
150 | 264 | --- |
151 | 265 |
|
152 | | -## 代码风格 |
| 266 | +## Code Style |
153 | 267 |
|
154 | | -FastExcel 使用 [Spotless](https://github.com/diffplug/spotless) 作为代码格式化工具。请确保在提交前运行以下命令以自动格式化代码: |
| 268 | +Apache Fesod (Incubating) uses [Spotless](https://github.com/diffplug/spotless) as its code formatting tool. Please |
| 269 | +ensure you run the following command to automatically format your code before submitting: |
155 | 270 |
|
156 | | -```shell |
157 | | -./mvnw spotless:apply |
| 271 | +```bash |
| 272 | +mvn spotless:apply |
158 | 273 | ``` |
159 | 274 |
|
160 | 275 | --- |
161 | 276 |
|
162 | | -**最后,感谢您对 FastExcel 的支持!每一份帮助,都是我们前进的动力。** |
| 277 | +Finally, thank you for your support of Apache Fesod (Incubating)! |
0 commit comments