Skip to content

Commit 7e18834

Browse files
authored
feat: add pr checker (#1180)
1 parent e2cb9da commit 7e18834

File tree

4 files changed

+71
-64
lines changed

4 files changed

+71
-64
lines changed

.github/PULL_REQUEST_TEMPLATE/template.md

-29
This file was deleted.

.github/PULL_REQUEST_TEMPLATE/template_en.md

-29
This file was deleted.

.github/pull_request_template.md

-6
This file was deleted.

.github/workflows/pr-checker.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: pr-checker
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Pull request
12+
uses: actions-cool/maintain-one-comment@v3
13+
with:
14+
token: ${{ secrets.GITHUB_TOKEN }}
15+
body: |
16+
🤭 感谢你的提交,请检查你的改动是否符合以下项目规范。
17+
18+
### 1. 格式化
19+
20+
我们项目中各种编程语言代码(包括文档)所采用的格式化工具不同,提交 pr 之前必须确保代码、文档正确格式化。
21+
22+
- .{md,js,ts,php,sql} 采用 prettier
23+
- .{c,cpp,java} 采用 clang-format
24+
- .{py} 采用 black
25+
- .{go} 采用 gofmt
26+
- 其它待完善
27+
28+
### 2. Git 提交信息
29+
30+
我们项目遵循 [AngularJS Git Commit Message Conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#) 规范,我们希望你的提交信息尽可能与项目保持一致。
31+
32+
- 新增或修改题解:feat: add/update solution(s) to lc problem(s): No.xxxx
33+
- 修复错误:fix: xxxx
34+
- 日常维护:chore: xxx
35+
36+
### 3. 其它补充
37+
38+
新增题解及代码时,需要创建 Solution.xxx 源代码文件(如果已存在,请确认算法是否更优,是则覆盖已有算法代码),同时,需要在 README.md 以及 README_EN.md 中添加对应的代码片段(英文文件中不要出现中文注释)
39+
40+
另外,编码风格(比如变量、函数的命名),尽量跟项目已有代码保持一致。
41+
42+
---
43+
44+
🤭 Thank you for your contribution. Please check if your changes comply with the following project specifications.
45+
46+
### 1. Formatting
47+
48+
We use different formatting tools for various programming languages (including documentation) in our project. You must ensure that the code and documentation are correctly formatted before submitting a pr.
49+
50+
- .{md,js,ts,php,sql} use prettier
51+
- .{c,cpp,java} use clang-format
52+
- .{py} use black
53+
- .{go} use gofmt
54+
- Others to be improved
55+
56+
### 2. Git Commit Message
57+
58+
Our project follows the [AngularJS Git Commit Message Conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#). We hope that your submission information is as consistent as possible with the project.
59+
60+
- Add or modify solutions: feat: add/update solution(s) to lc problem(s): No.xxxx
61+
- Fix errors: fix: xxxx
62+
- Routine maintenance: chore: xxx
63+
64+
### 3. Other notes
65+
66+
When adding solutions and code, you need to create a Solution.xxx source code file (if it already exists, please confirm whether the algorithm is better, if yes, overwrite the existing algorithm code), and at the same time, you need to add the corresponding code snippets in README.md and README_EN.md (do not have Chinese comments in the English file)
67+
68+
In addition, the coding style (such as the naming of variables and functions) should be as consistent as possible with the existing code in the project.
69+
70+
<!-- Sticky Pull Request Comment -->
71+
body-include: '<!-- Sticky Pull Request Comment -->'

0 commit comments

Comments
 (0)