proof-pr 0.1.10 → 0.1.11

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 CHANGED
@@ -12,7 +12,7 @@ ProofPR 是给开源维护者和工程团队使用的 PR 证据门禁。它在
12
12
  npx proof-pr@latest --version
13
13
  ```
14
14
 
15
- 当前应输出 `0.1.10`。
15
+ 当前应输出 `0.1.11`。
16
16
 
17
17
  初始化配置和 GitHub Action:
18
18
 
@@ -37,7 +37,7 @@ npx proof-pr@latest scan --diff-file examples/cases/workflow-untrusted-checkout.
37
37
  生成独立 HTML 可视化报告:
38
38
 
39
39
  ```bash
40
- npx proof-pr@latest scan --base origin/main --head HEAD --locale zh-CN --format html > proofpr-report.html
40
+ npx proof-pr@latest scan --base origin/main --head HEAD --locale zh-CN --format html --output proofpr-report.html
41
41
  ```
42
42
 
43
43
  运行 benchmark:
@@ -49,7 +49,7 @@ npx proof-pr@latest benchmark --cases benchmarks/cases
49
49
  ## GitHub Action
50
50
 
51
51
  ```yaml
52
- - uses: linsk27/proof-pr@v0.1.10
52
+ - uses: linsk27/proof-pr@v0.1.11
53
53
  with:
54
54
  fail-on: high
55
55
  comment: "true"
@@ -62,7 +62,7 @@ npx proof-pr@latest benchmark --cases benchmarks/cases
62
62
  - 证据评分:0-100 分。
63
63
  - Review 门禁:正常 review、重点 review、先补证据、风险处理前不要合并。
64
64
  - Review 行动清单:维护者可直接执行的 checklist。
65
- - 可选输出:GitHub annotations、SARIF、benchmark report、独立 HTML 可视化报告。
65
+ - 可选输出:GitHub annotations、SARIF、benchmark report、独立 HTML 可视化报告;CLI 可用 `--output` 直接写文件。
66
66
 
67
67
  ## 常用预设
68
68
 
package/dist/index.js CHANGED
@@ -25732,7 +25732,7 @@ const build_program = new Command();
25732
25732
  build_program
25733
25733
  .name("proof-pr")
25734
25734
  .description("Review pull request evidence, scope, and safety before maintainers spend time on it.")
25735
- .version("0.1.10");
25735
+ .version("0.1.11");
25736
25736
  build_program
25737
25737
  .command("scan", { isDefault: true })
25738
25738
  .description("Scan a git diff and print a ProofPR report.")
@@ -25744,6 +25744,7 @@ build_program
25744
25744
  .option("--pr-body-file <path>", "Read a pull request body from a Markdown file.")
25745
25745
  .option("--config <path>", "Path to .proofpr.yml.", ".proofpr.yml")
25746
25746
  .option("--format <format>", "Output format: markdown, json, sarif, or html.", parseFormat, "markdown")
25747
+ .option("--output <path>", "Write report output to a file instead of stdout.")
25747
25748
  .option("--locale <locale>", "Report language: en or zh-CN.")
25748
25749
  .option("--fail-on <level>", "Exit with code 1 on risk level: low, medium, high, or never.", parseFailLevel, "never")
25749
25750
  .action(async (options) => {
@@ -25758,7 +25759,13 @@ build_program
25758
25759
  const result = scanDiff(diffText, { config, pullRequest });
25759
25760
  const locale = parseLocale(options.locale, config.locale);
25760
25761
  const output = renderOutput(result, options.format, locale);
25761
- process.stdout.write(`${output}\n`);
25762
+ if (options.output) {
25763
+ await writeOutput(options.output, `${output}\n`);
25764
+ process.stdout.write(`ProofPR ${options.format} report written to ${options.output}\n`);
25765
+ }
25766
+ else {
25767
+ process.stdout.write(`${output}\n`);
25768
+ }
25762
25769
  if (riskMeetsThreshold(result.risk, options.failOn)) {
25763
25770
  process.exitCode = 1;
25764
25771
  }
@@ -25871,7 +25878,7 @@ jobs:
25871
25878
  runs-on: ubuntu-latest
25872
25879
  steps:
25873
25880
  - uses: actions/checkout@v4
25874
- - uses: linsk27/proof-pr@v0.1.10
25881
+ - uses: linsk27/proof-pr@v0.1.11
25875
25882
  with:
25876
25883
  fail-on: ${failOn}
25877
25884
  comment: "true"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proof-pr",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "CLI for ProofPR, a maintainer-focused pull request evidence scanner.",
5
5
  "license": "MIT",
6
6
  "type": "module",