Merged
Conversation
…時に全パーサーでコンパイルエラーを発生させるガードが必要 - ParsedNames 構造体を domain/entity/name.rs に追加(Default 非実装) - Parser::parse_names の戻り値を Vec<RawName> → ParsedNames に変更 - 全7言語パーサー + Dispatcher + usecase で17個のコンパイルエラーを確認 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ind 追加時に全パーサーでコンパイルエラーを発生させるガードが必要 - ParsedNames 構造体(Default 非実装)により構造体フィールド網羅性でガード - partition_names ヘルパーで Vec<RawName> → ParsedNames への変換を共通化 - PHP / Python に Variable 抽出を追加(property_declaration, const_declaration / assignment) - usecase 側で into_all() により Vec<RawName> に flatten - 全テスト通過確認 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Parser::parse_namesの戻り値をVec<RawName>からParsedNames構造体に変更ParsedNamesに新フィールドを追加すると、Default未実装のため全パーサーでコンパイルエラーが発生し対応漏れを防止NameKind::Variable抽出を追加(これまで未対応だった)背景
従来の
Vec<RawName>戻り値では、新しいNameKindを追加しても既存パーサーがそれを無視(空 Vec を返す)してもコンパイルが通ってしまい、対応漏れが検出できなかった。ParsedNames構造体(Default非実装)を使うことで、Rust の構造体フィールド網羅性チェックにより、新フィールド追加時に全パーサーでコンパイルエラーが発生するようになった。変更箇所
domain/entity/name.rs:ParsedNames構造体 +into_all()メソッド追加domain/repository/parser.rs:Parserトレイトの戻り値変更infrastructure/parser/mod.rs:partition_names()ヘルパー追加、DispatchingParser対応infrastructure/parser/*.rs: 全7言語パーサーをParsedNames対応に修正infrastructure/parser/php.rs:property_declaration/const_declarationの Variable 抽出追加infrastructure/parser/python.rs:assignmentの Variable 抽出追加usecase/check_architecture.rs:into_all()で flatten、NoOpParsermock 更新Test plan
cargo checkでコンパイルエラー0件cargo testで全351テスト通過--no-verifyコミット)→ GREEN(全修正 → lefthook 通過)🤖 Generated with Claude Code