Skip to content

Commit

Permalink
Merge pull request #129 from devchat-ai/update_pr_readme
Browse files Browse the repository at this point in the history
feat: Add README files and update PR command structure
  • Loading branch information
kagami-l authored Jul 19, 2024
2 parents a4005b6 + e03d1eb commit b3b01a3
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 2 deletions.
30 changes: 30 additions & 0 deletions merico/commit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Commit 命令

该命令用于为选中的代码更改编写格式良好的提交信息,并通过Git提交这些更改。

## 用法
/commit [to close #issue_number]


## 说明

- 该命令会引导你完成以下步骤:

1. 选择要包含在本次提交中的修改文件
2. 查看并编辑AI生成的提交信息
3. 确认并执行Git提交

- 你可以选择性地在命令中包含要关闭的issue编号,例如:

/commit to close #12


- 如果不指定issue编号,命令仍会正常执行,只是不会在提交信息中包含关闭issue的引用。

- 该命令会调用Git来执行实际的提交操作,因此请确保你的系统中已正确安装并配置了Git。

## 提示

- 在执行该命令之前,请确保你已经对要提交的文件进行了必要的修改。
- 仔细检查AI生成的提交信息,并根据需要进行编辑,以确保信息准确反映了你的更改。
- 养成经常小批量提交的好习惯,这有助于更好地跟踪项目历史。
1 change: 1 addition & 0 deletions merico/commit/command.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
description: 'Writes a well-formatted commit message for selected code changes and commits them via Git. Include an issue number if desired (e.g., input "/commit to close #12").'
hint: to close Issue #issue_number
input: optional
help: README.md
steps:
- run: $devchat_python $command_path/commit.py "$input"
34 changes: 34 additions & 0 deletions merico/pr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# pr 命令

pr命令是一个用于处理Pull Requests (PRs)的主命令。它本身不执行具体操作,而是通过子命令来完成特定功能。

## 可用子命令

1. pr.review - 生成PR代码评审描述
2. pr.improve - 生成PR的代码建议
3. pr.describe - 生成PR描述
4. pr.custom_suggestions - 生成PR的自定义代码建议

## 使用方法

要使用pr命令的功能,请使用以下格式调用相应的子命令:

/pr.<子命令> <PR_URL>

例如:
- /pr.review https://github.com/devchat-ai/devchat/pull/301
- /pr.improve https://github.com/devchat-ai/devchat/pull/301
- /pr.describe https://github.com/devchat-ai/devchat/pull/301
- /pr.custom_suggestions https://github.com/devchat-ai/devchat/pull/301

## 子命令说明

1. pr.review: 分析PR并生成代码评审描述,帮助审阅者快速了解PR的内容和影响。

2. pr.improve: 分析PR并提供代码改进建议,帮助开发者优化其代码。

3. pr.describe: 自动生成PR的描述,总结PR的主要变更和目的。

4. pr.custom_suggestions: 根据特定需求生成自定义的PR代码建议。

请根据您的具体需求选择适当的子命令。每个子命令都专注于PR处理的不同方面,帮助您更高效地管理和改进Pull Requests。
3 changes: 2 additions & 1 deletion merico/pr/command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ description: "pr command"
workflow_python:
env_name: devchat-pr-env4
version: 3.11.0
dependencies: requirements.txt
dependencies: requirements.txt
help: README.md
24 changes: 24 additions & 0 deletions merico/pr/config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# pr.config

**/pr.config命令用于配置Git工作流所需的设置。**


该命令允许用户配置以下选项:

1. PR Review Inline: 启用或禁用PR内联评审功能。

使用方式:
直接运行 /pr.config 命令,无需额外参数。

命令会引导用户通过交互式界面进行配置。用户可以选择是否启用PR内联评审功能。


配置文件位置:
全局配置文件保存在用户主目录下的 ~/.chat/.workflow_config.json


注意:
- 如需修改访问令牌或主机URL,请直接编辑配置文件。
- 配置更改后会立即生效。

这个命令可以帮助用户快速设置Git工作流所需的重要配置项,提高使用效率。
1 change: 1 addition & 0 deletions merico/pr/config/command.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
description: 'Config required settings for GIT workflows.'
help: README.md
steps:
- run: $devchat_python $command_path/command.py
1 change: 1 addition & 0 deletions merico/pr/custom_suggestions/command.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
description: "review pr"
input: required
help: README.md
steps:
- run: $workflow_python $command_path/../command.py "$input" custom_suggestions
1 change: 1 addition & 0 deletions merico/pr/describe/command.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
description: "review pr"
input: required
help: README.md
steps:
- run: $workflow_python $command_path/../command.py "$input" describe
2 changes: 1 addition & 1 deletion merico/pr/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
git+https://gitee.com/imlaji/pr-agent.git@ad276e206c7e462a689996ee3ada2769b35d5625
git+https://gitee.com/devchat-ai/devchat.git@main
git+https://gitee.com/devchat-ai/devchat.git@pr_env
1 change: 1 addition & 0 deletions merico/pr/review/command.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
description: "review pr"
input: required
help: README.md
steps:
- run: $workflow_python $command_path/../command.py "$input" review

0 comments on commit b3b01a3

Please sign in to comment.