Skip to content

#324 error_parentをerror_pipelineに変更 - #325

Merged
Dminin2 merged 1 commit into
mainfrom
refactor/324-rename-error-parent
Nov 6, 2025
Merged

#324 error_parentをerror_pipelineに変更#325
Dminin2 merged 1 commit into
mainfrom
refactor/324-rename-error-parent

Conversation

@Dminin2

@Dminin2 Dminin2 commented Nov 6, 2025

Copy link
Copy Markdown
Owner

変更点

タイトル通りです

懸念点

Summary by CodeRabbit

リリースノート

  • Refactor
    • 内部エラーハンドリングロジックの最適化を実施しました。

このリリースはユーザー向けの新機能や変更を含みません。内部的な改善のみとなります。

@Dminin2 Dminin2 self-assigned this Nov 6, 2025
@Dminin2 Dminin2 linked an issue Nov 6, 2025 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Nov 6, 2025

Copy link
Copy Markdown
Contributor

ウォークスルー

エクスポートされた関数 error_parenterror_pipeline に名前変更する一連のコミットです。関数の署名、動作、制御フローは変わらず、宣言と実装、全呼び出し元にわたる単純な識別子の置き換えとなっています。

変更内容

コホート / ファイル 変更内容
ヘッダ宣言
includes/utils.h
関数 error_parenterror_pipeline に名前変更
エラーハンドラ実装
srcs/utils/error.c
パブリック関数 error_parenterror_pipeline に名前変更;機能は変わらず
エラーハンドラ呼び出し元
srcs/executor/execute.c, srcs/executor/process.c, srcs/executor/run_in_parent.c
全エラーハンドリングパスで error_parent(...)error_pipeline(...) に置き換え

コード審査の推定負荷

🎯 1 (Trivial) | ⏱️ ~5 分

  • 単純で繰り返し的なリネーミング操作
  • 動作・制御フローの変更なし
  • 呼び出し元の変更はすべて同一パターン

関連する可能性のあるプルリクエスト

  • PR #314: 同じエラーハンドリングAPI(error_parent)を修正しており、このPRではそれをerror_pipelineに名前変更している直接的な関連性
  • PR #214: このPRが前のPRで導入されたerror_parenterror_pipelineに置き換える名前変更の連鎖を継続

推奨レビュアー

  • hayase-m

🐰 親から導管へ、名前は変わり
関数の心、変わらず流れ
整然と置き換え、全箇所に響く
シンプルなリネーム、きれいに収まる
エラー処理よ、新しき名で輝け!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PRのタイトルはerror_parentをerror_pipelineに変更することを正確に説明しており、差分内容の主要な変更と完全に一致しています。
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/324-rename-error-parent

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99624d6 and 644d04e.

📒 Files selected for processing (5)
  • includes/utils.h (2 hunks)
  • srcs/executor/execute.c (3 hunks)
  • srcs/executor/process.c (2 hunks)
  • srcs/executor/run_in_parent.c (4 hunks)
  • srcs/utils/error.c (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{c,h}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

norminetteのルールに従ってください

Files:

  • includes/utils.h
  • srcs/utils/error.c
  • srcs/executor/run_in_parent.c
  • srcs/executor/execute.c
  • srcs/executor/process.c
🧠 Learnings (4)
📚 Learning: 2025-11-04T08:12:19.705Z
Learnt from: Dminin2
Repo: Dminin2/minishell PR: 294
File: srcs/main.c:91-92
Timestamp: 2025-11-04T08:12:19.705Z
Learning: In the minishell codebase (C), the pipeline allocated by expand() in srcs/main.c is freed inside the execute() function. Both execution paths (run_builtin_in_parent() and child_process()) call free_pipeline(pipeline) at the end, so no additional free_pipeline() call is needed after execute() in main.c.

Applied to files:

  • includes/utils.h
  • srcs/utils/error.c
  • srcs/executor/run_in_parent.c
  • srcs/executor/execute.c
  • srcs/executor/process.c
📚 Learning: 2025-10-26T13:45:14.047Z
Learnt from: Dminin2
Repo: Dminin2/minishell PR: 238
File: includes/common.h:27-29
Timestamp: 2025-10-26T13:45:14.047Z
Learning: In the minishell codebase (C), the exit_error() function in srcs/utils/exit.c always calls exit() and never returns. Therefore, when exit_error() is called in a conditional branch, no else clause is needed for subsequent exit_error() calls since the first call will terminate the process.

Applied to files:

  • includes/utils.h
  • srcs/utils/error.c
  • srcs/executor/execute.c
📚 Learning: 2025-11-06T09:00:52.010Z
Learnt from: Dminin2
Repo: Dminin2/minishell PR: 319
File: srcs/utils/error_msg.c:29-31
Timestamp: 2025-11-06T09:00:52.010Z
Learning: In the minishell project (Dminin2/minishell), the ERR_HEREDOC error message format in srcs/utils/error_msg.c intentionally includes a closing parenthesis `)` in the format string `"\nminishell: %s `%s')\n"` to match bash's heredoc error format: "warning: here-document delimited by end-of-file (wanted `EOF')", where HD_ERR contains the opening parenthesis.

Applied to files:

  • includes/utils.h
📚 Learning: 2025-11-05T05:49:22.269Z
Learnt from: Dminin2
Repo: Dminin2/minishell PR: 305
File: libft/srcs/get_next_line/get_next_line_utils.c:44-56
Timestamp: 2025-11-05T05:49:22.269Z
Learning: In the minishell project (C language), get_next_line(-1) calls save_cleanup() to free all fd buffers in the static save array. This is only called in non-interactive mode right before program termination (during syntax error handling, exit_error, exit_success, and main cleanup), so there is no risk of use-after-free since no subsequent get_next_line calls will occur.

Applied to files:

  • srcs/executor/run_in_parent.c
  • srcs/executor/execute.c
🧬 Code graph analysis (4)
includes/utils.h (1)
srcs/utils/error.c (1)
  • error_pipeline (55-63)
srcs/executor/run_in_parent.c (1)
srcs/utils/error.c (1)
  • error_pipeline (55-63)
srcs/executor/execute.c (1)
srcs/utils/error.c (1)
  • error_pipeline (55-63)
srcs/executor/process.c (3)
srcs/utils/error.c (1)
  • error_pipeline (55-63)
srcs/executor/pipe.c (1)
  • pipe_pipes (41-53)
libft/srcs/libft/ft_calloc.c (1)
  • ft_calloc (15-41)
🔇 Additional comments (5)
srcs/executor/process.c (1)

101-112: リネームが正しく適用されています。

error_parent から error_pipeline への変更が一貫して適用されており、関数シグネチャとエラー処理のロジックも保持されています。

srcs/executor/run_in_parent.c (1)

22-78: リネームと書式設定が適切です。

error_parent から error_pipeline への変更が全ての呼び出し箇所で正しく適用されています。Lines 28-29の複数行フォーマットも可読性を向上させています。

includes/utils.h (1)

64-66: 公開API宣言が正しく更新されています。

関数宣言が error_parent から error_pipeline に変更され、実装(srcs/utils/error.c)と一致しています。シグネチャに変更はありません。

srcs/utils/error.c (1)

55-63: 関数実装が正しくリネームされています。

error_parent から error_pipeline への関数定義の変更が正しく行われており、関数の動作は変更されていません。ヘッダー宣言とも一致しています。

srcs/executor/execute.c (1)

76-91: エラーハンドラの呼び出しが正しく更新されています。

execute 関数内の全ての error_parent 呼び出しが error_pipeline に変更されており、エラー処理のロジックも適切に保持されています。


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@Dminin2
Dminin2 requested a review from hayase-m November 6, 2025 15:19

@hayase-m hayase-m left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Dminin2
Dminin2 merged commit b1addc6 into main Nov 6, 2025
2 checks passed
@Dminin2
Dminin2 deleted the refactor/324-rename-error-parent branch November 6, 2025 15:52
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.

error_parentをerror_pipelineに変更

2 participants