docs: update usage and clean clippy warnings
This commit is contained in:
@@ -1,31 +1,61 @@
|
||||
这是一个读取 gitea PR, 将其内容 (主要是评阅意见) 整理为 LLM 友好的 markdown 文件的项目.
|
||||
这是一个读取 Gitea PR,并将其内容整理为 LLM 友好的文档的项目。
|
||||
|
||||
使用:
|
||||
主要输出两种格式:
|
||||
|
||||
1. `markdown`:直接面向 LLM 的可读文档,重点保留 review/comment/reply 内容。
|
||||
2. `json`:结构化输出,便于二次处理。
|
||||
|
||||
使用:
|
||||
|
||||
```bash
|
||||
GITEA_PR_CLI_API_TOKEN=...
|
||||
GITEA_PR_CLI_URL=https://gitea.com
|
||||
# 或用参数指定 --repo 在最开头
|
||||
GITEA_PR_CLI_REPO=Origami404/aaa
|
||||
gitea-pr-review <pr-index>
|
||||
|
||||
# 默认输出 markdown 到 stdout
|
||||
gitea-pr-review fetch <pr-index>
|
||||
|
||||
# 输出 json 到 stdout
|
||||
gitea-pr-review fetch <pr-index> --format json
|
||||
|
||||
# 输出到文件
|
||||
gitea-pr-review fetch <pr-index> --format json --out pr.json
|
||||
gitea-pr-review fetch <pr-index> --out pr.md
|
||||
|
||||
# 从已有 json 重新生成 markdown
|
||||
gitea-pr-review render-md --in pr.json
|
||||
gitea-pr-review render-md --in pr.json --out pr.md
|
||||
```
|
||||
|
||||
返回:
|
||||
返回的 markdown 结构大致如下:
|
||||
|
||||
`````md
|
||||
# <repo> `#<pr-index>` <pr-title>
|
||||
|
||||
<各种基本信息, LLM 决定展示形式>
|
||||
## Metadata
|
||||
|
||||
## Reivew 1 (<review 结果>)
|
||||
> <发起人>
|
||||
### Commits
|
||||
- <sha-short> <title> (<author>, <date>)
|
||||
|
||||
### Diff Stat
|
||||
- files changed: <n>
|
||||
- additions: <n>
|
||||
- deletions: <n>
|
||||
- <file-path>: +<additions>, -<deletions>
|
||||
|
||||
## Review 1 (<review-state>)
|
||||
> <reviewer>
|
||||
|
||||
### Comment 1.1
|
||||
<文件名>:<行号>
|
||||
<用户>: 说了 xxx
|
||||
... (后续用户回复)
|
||||
|
||||
### Comment 1.2
|
||||
...
|
||||
<file>:<line>
|
||||
<user>:
|
||||
```md
|
||||
<原始评论正文>
|
||||
```
|
||||
|
||||
### Reply 1.1.1
|
||||
<user>:
|
||||
```md
|
||||
<原始回复正文>
|
||||
```
|
||||
`````
|
||||
|
||||
Reference in New Issue
Block a user