proof-pr 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/dist/index.js +11 -67
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,12 +6,22 @@ ProofPR 是给开源维护者和工程团队使用的 PR 证据门禁。它在
|
|
|
6
6
|
|
|
7
7
|
## 快速使用
|
|
8
8
|
|
|
9
|
+
确认 latest 版本:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx proof-pr@latest --version
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
当前应输出 `0.1.10`。
|
|
16
|
+
|
|
9
17
|
初始化配置和 GitHub Action:
|
|
10
18
|
|
|
11
19
|
```bash
|
|
12
|
-
npx proof-pr@latest init
|
|
20
|
+
npx proof-pr@latest init
|
|
13
21
|
```
|
|
14
22
|
|
|
23
|
+
这个命令会生成 `.proofpr.yml` 和 `.github/workflows/proofpr.yml`,提交后打开 PR 即可看到报告。
|
|
24
|
+
|
|
15
25
|
本地扫描当前分支:
|
|
16
26
|
|
|
17
27
|
```bash
|
|
@@ -39,7 +49,7 @@ npx proof-pr@latest benchmark --cases benchmarks/cases
|
|
|
39
49
|
## GitHub Action
|
|
40
50
|
|
|
41
51
|
```yaml
|
|
42
|
-
- uses: linsk27/proof-pr@v0.1.
|
|
52
|
+
- uses: linsk27/proof-pr@v0.1.10
|
|
43
53
|
with:
|
|
44
54
|
fail-on: high
|
|
45
55
|
comment: "true"
|
package/dist/index.js
CHANGED
|
@@ -23726,14 +23726,13 @@ function renderHtmlReport(result, locale = "en") {
|
|
|
23726
23726
|
<h2>${labels.reviewPlan}</h2>
|
|
23727
23727
|
<div class="action-list">
|
|
23728
23728
|
${result.reviewPlan.actionItems.length > 0
|
|
23729
|
-
? result.reviewPlan.actionItems.map((action) =>
|
|
23730
|
-
<div class="action">
|
|
23729
|
+
? result.reviewPlan.actionItems.map((action) => `<div class="action">
|
|
23731
23730
|
<span class="box"></span>
|
|
23732
23731
|
<div>
|
|
23733
23732
|
<div class="action-title">${escapeHtml(localizeActionTitle(action.actionId, action.title, locale))}<span class="priority">${escapeHtml(formatPriority(action.priority, locale))}</span></div>
|
|
23734
23733
|
<div class="muted">${escapeHtml(localizeActionDetail(action.actionId, action.detail, locale))}</div>
|
|
23735
23734
|
</div>
|
|
23736
|
-
</div>`).join("\n")
|
|
23735
|
+
</div>`).join("\n ")
|
|
23737
23736
|
: `<div class="muted">${labels.noActions}</div>`}
|
|
23738
23737
|
</div>
|
|
23739
23738
|
</article>
|
|
@@ -23752,11 +23751,10 @@ function renderHtmlReport(result, locale = "en") {
|
|
|
23752
23751
|
<h2>${labels.focusFiles}</h2>
|
|
23753
23752
|
<div class="focus-list">
|
|
23754
23753
|
${result.reviewPlan.focusFiles.length > 0
|
|
23755
|
-
? result.reviewPlan.focusFiles.map((file) =>
|
|
23756
|
-
<div class="focus">
|
|
23754
|
+
? result.reviewPlan.focusFiles.map((file) => `<div class="focus">
|
|
23757
23755
|
<div><code>${escapeHtml(file.path)}</code></div>
|
|
23758
23756
|
<div class="muted">${escapeHtml(localizeFocusReason(file.reasonId, file.reason, locale))}</div>
|
|
23759
|
-
</div>`).join("\n")
|
|
23757
|
+
</div>`).join("\n ")
|
|
23760
23758
|
: `<div class="muted">${labels.noFocusFiles}</div>`}
|
|
23761
23759
|
</div>
|
|
23762
23760
|
</article>
|
|
@@ -23765,11 +23763,10 @@ function renderHtmlReport(result, locale = "en") {
|
|
|
23765
23763
|
<h2>${labels.scoreDetails}</h2>
|
|
23766
23764
|
<div class="deduction-list">
|
|
23767
23765
|
${result.evidenceScore.deductions.length > 0
|
|
23768
|
-
? result.evidenceScore.deductions.map((deduction) =>
|
|
23769
|
-
<div class="deduction">
|
|
23766
|
+
? result.evidenceScore.deductions.map((deduction) => `<div class="deduction">
|
|
23770
23767
|
<strong>-${deduction.points}</strong>
|
|
23771
23768
|
<div class="muted">${escapeHtml(localizeDeduction(deduction.reasonId, deduction.message, locale))}</div>
|
|
23772
|
-
</div>`).join("\n")
|
|
23769
|
+
</div>`).join("\n ")
|
|
23773
23770
|
: `<div class="muted">${labels.noDeductions}</div>`}
|
|
23774
23771
|
</div>
|
|
23775
23772
|
</article>
|
|
@@ -25735,7 +25732,7 @@ const build_program = new Command();
|
|
|
25735
25732
|
build_program
|
|
25736
25733
|
.name("proof-pr")
|
|
25737
25734
|
.description("Review pull request evidence, scope, and safety before maintainers spend time on it.")
|
|
25738
|
-
.version("0.1.
|
|
25735
|
+
.version("0.1.10");
|
|
25739
25736
|
build_program
|
|
25740
25737
|
.command("scan", { isDefault: true })
|
|
25741
25738
|
.description("Scan a git diff and print a ProofPR report.")
|
|
@@ -25777,7 +25774,7 @@ build_program
|
|
|
25777
25774
|
.action(async (options) => {
|
|
25778
25775
|
await writeIfMissing(options.configPath, renderConfigTemplate(options.preset), options.force);
|
|
25779
25776
|
await writeIfMissing(options.workflowPath, renderWorkflowTemplate(options.failOn), options.force);
|
|
25780
|
-
process.stdout.write(`ProofPR initialized:\n- ${options.configPath}\n- ${options.workflowPath}\n`);
|
|
25777
|
+
process.stdout.write(`ProofPR initialized.\n\nCreated:\n- ${options.configPath}\n- ${options.workflowPath}\n\nNext:\n1. Commit these files.\n2. Open or update a pull request.\n3. Read the ProofPR comment or Actions summary.\n\nLocal check:\nnpx proof-pr@latest scan --base origin/main --head HEAD --locale zh-CN\n`);
|
|
25781
25778
|
});
|
|
25782
25779
|
build_program
|
|
25783
25780
|
.command("benchmark")
|
|
@@ -25854,61 +25851,8 @@ preset: ${preset}
|
|
|
25854
25851
|
comment:
|
|
25855
25852
|
enabled: true
|
|
25856
25853
|
|
|
25857
|
-
#
|
|
25858
|
-
#
|
|
25859
|
-
#
|
|
25860
|
-
# 可用预设:
|
|
25861
|
-
# - balanced
|
|
25862
|
-
# - open-source-maintainer
|
|
25863
|
-
# - security-strict
|
|
25864
|
-
# - ai-generated-pr
|
|
25865
|
-
# - mcp-security
|
|
25866
|
-
# - dependency-careful
|
|
25867
|
-
#
|
|
25868
|
-
# 也可以取消注释下面这些字段,覆盖 preset 的默认值。
|
|
25869
|
-
# riskThreshold: high
|
|
25870
|
-
#
|
|
25871
|
-
# sensitivePaths:
|
|
25872
|
-
# - ".github/workflows/**"
|
|
25873
|
-
# - ".github/actions/**"
|
|
25874
|
-
# - "**/.env*"
|
|
25875
|
-
# - "**/mcp*.json"
|
|
25876
|
-
# - "**/*mcp*.json"
|
|
25877
|
-
# - "Dockerfile"
|
|
25878
|
-
# - "**/Dockerfile"
|
|
25879
|
-
# - "package.json"
|
|
25880
|
-
# - "pnpm-lock.yaml"
|
|
25881
|
-
# - "package-lock.json"
|
|
25882
|
-
# - "yarn.lock"
|
|
25883
|
-
# - "bun.lockb"
|
|
25884
|
-
#
|
|
25885
|
-
# requireTests:
|
|
25886
|
-
# enabled: true
|
|
25887
|
-
# paths:
|
|
25888
|
-
# - "src/**"
|
|
25889
|
-
# - "packages/**/src/**"
|
|
25890
|
-
# - "app/**"
|
|
25891
|
-
# - "lib/**"
|
|
25892
|
-
#
|
|
25893
|
-
# secrets:
|
|
25894
|
-
# enabled: true
|
|
25895
|
-
#
|
|
25896
|
-
# dependencies:
|
|
25897
|
-
# flagNewPackages: true
|
|
25898
|
-
# flagMajorUpgrades: true
|
|
25899
|
-
# flagLifecycleScripts: true
|
|
25900
|
-
#
|
|
25901
|
-
# evidence:
|
|
25902
|
-
# contracts:
|
|
25903
|
-
# - id: ui-screenshot
|
|
25904
|
-
# title: UI changes need screenshots
|
|
25905
|
-
# paths:
|
|
25906
|
-
# - "src/components/**"
|
|
25907
|
-
# - "app/**"
|
|
25908
|
-
# requires:
|
|
25909
|
-
# - screenshot
|
|
25910
|
-
# - verification
|
|
25911
|
-
# severity: medium
|
|
25854
|
+
# 想更严格时,把 preset 改成 security-strict / dependency-careful / mcp-security。
|
|
25855
|
+
# 详细配置见 docs/configuration.md。
|
|
25912
25856
|
`;
|
|
25913
25857
|
}
|
|
25914
25858
|
function renderWorkflowTemplate(failOn) {
|
|
@@ -25927,7 +25871,7 @@ jobs:
|
|
|
25927
25871
|
runs-on: ubuntu-latest
|
|
25928
25872
|
steps:
|
|
25929
25873
|
- uses: actions/checkout@v4
|
|
25930
|
-
- uses: linsk27/proof-pr@v0.1.
|
|
25874
|
+
- uses: linsk27/proof-pr@v0.1.10
|
|
25931
25875
|
with:
|
|
25932
25876
|
fail-on: ${failOn}
|
|
25933
25877
|
comment: "true"
|