Skip to content

Delegate fail to fail_with_code (DSK-125)#166

Merged
daisuke8000 merged 1 commit into
mainfrom
fix/dsk-125-fail-delegate
Jul 5, 2026
Merged

Delegate fail to fail_with_code (DSK-125)#166
daisuke8000 merged 1 commit into
mainfrom
fix/dsk-125-fail-delegate

Conversation

@daisuke8000

@daisuke8000 daisuke8000 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • fail() now delegates to fail_with_code(report, 1) instead of duplicating eprintln! and process::exit.

Test plan

  • cargo fmt --all --check
  • cargo audit
  • cargo build --workspace --locked
  • cargo test -p rustern
  • Local CodeRabbit review (0 findings)

Made with Cursor

Summary by CodeRabbit

  • Bug Fixes
    • 失敗時のエラー表示と終了処理が統一され、エラー時の挙動がより一貫しました。
    • 失敗時の終了コードの扱いが整理され、今後の保守性が向上しました。

Unify error reporting so fail() reuses fail_with_code(report, 1) instead of duplicating eprintln and process::exit.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 11035449-a549-4a8b-b328-af13cba1544e

📥 Commits

Reviewing files that changed from the base of the PR and between 2029bba and 5988695.

📒 Files selected for processing (1)
  • src/report.rs

📝 Walkthrough

Walkthrough

src/report.rs内のfail関数が、eprintln!とprocess::exit(1)を直接実行する実装から、fail_with_code(report, 1)を呼び出す実装に変更されました。これにより失敗時の表示・終了処理はfail_with_code側に集約されます。公開されているシグネチャの変更はありません。

Changes

変更内容(重大度: 低)

  • src/report.rs: fail関数の内部実装をfail_with_codeへの委譲に変更(+1/-2行)

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant fail
  participant fail_with_code
  Caller->>fail: fail(report)
  fail->>fail_with_code: fail_with_code(report, 1)
  fail_with_code-->>Caller: process::exit(1)
Loading

関連する課題: なし

関連するPR: なし

サジェストラベル: refactor, low-risk

サジェストレビュアー: なし

エラーは一つ、道は二つあれど
fail_with_codeへ、静かに委ねる
exit(1)は変わらず待つ
コードは軽く、意図は重く
うさぎ、コミットに小さく跳ねる 🐇

🚥 Pre-merge checks | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning Conventional Commits の接頭辞がなく、要件を満たしていません。 refactor: delegate fail to fail_with_code (DSK-125) のように prefix を付け、変更内容が分かる具体名にしてください。
Description check ⚠️ Warning 必須テンプレートの「概要」「変更理由」がなく、代わりに英語の Summary/Test plan になっています。 テンプレートどおりに「## 概要」「## 変更理由」を追加し、変更内容と理由を具体的に記載してください。

Comment @coderabbitai help to get the list of available commands.

@daisuke8000
daisuke8000 merged commit 657fa4d into main Jul 5, 2026
3 checks passed
@daisuke8000
daisuke8000 deleted the fix/dsk-125-fail-delegate branch July 5, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant