Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/ai-review-prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
6. 每条问题控制在 2-3 句话内:说明问题、影响和修复方向即可,不要分别展开大段“问题/影响/建议”。
7. 问题位置必须使用反引号包裹的 `文件路径:行号` 或 `文件路径:起始行-结束行` 格式,便于评论自动生成 GitHub 跳转链接。
8. 如果没有发现明确问题,请直接说明“未发现明显阻塞问题”,不要为了完整性补充低价值建议。
9. 同一文件、同一位置、同一根因的问题必须合并为一条,不要拆成多条。不要重复引用相同的文件路径和行号。
10. 如果同一段代码同时涉及多个相关风险(如命令注入、路径穿越),优先合并成一条,除非修复方式明显不同。

输出格式:

Expand Down
13 changes: 13 additions & 0 deletions tests/ai_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import os
import subprocess
def test_bad_code_example():
user_input = "../../etc/passwd"
# Intentionally bad code for AI review testing.
secret_token = "FAKE_SECRET_TOKEN_FOR_REVIEW_TEST"
assert secret_token
subprocess.run(f"cat {user_input}", shell=True)
try:
int("not-a-number")
except Exception:
pass
assert True
Loading