Skip to content

親フレーバーをhooq.tomlで定義した際、デフォルトの子フレーバーにその親フレーバーの設定が引き継がれない問題の修正#159

Open
anotherhollow1125 wants to merge 5 commits intomainfrom
fix/flavor
Open

親フレーバーをhooq.tomlで定義した際、デフォルトの子フレーバーにその親フレーバーの設定が引き継がれない問題の修正#159
anotherhollow1125 wants to merge 5 commits intomainfrom
fix/flavor

Conversation

@anotherhollow1125
Copy link
Copy Markdown
Owner

@anotherhollow1125 anotherhollow1125 commented Feb 7, 2026

📌 Overview / 概要

表題の通り。イシュー #158 を解決した。

⚙ Changes / 変更点

  • hooq.tomlからフレーバーを読み込む処理周りの修正
  • 伴い、ドキュメントの修正

🧪 Tests / テスト

  • テストの修正はなし

📚 Related Issues / 関連Issue

✅ Checklist

  • I’ve added or updated tests. (必要なテストを用意しました)
  • I’ve updated documentation or comments if needed. (必要に応じてドキュメント/コメントを更新しました)
  • I’ve considered backward compatibility (if public API is changed). (公開されているAPIが変化する場合、後方互換性に配慮しました)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

hooq.toml で親フレーバーを定義した場合に、デフォルトの子フレーバーへ設定が継承されない不具合(#158)を解消するため、フレーバー構造と読み込み適用ロジックを継承可能な形へ変更し、併せてドキュメントのソース抜粋位置を更新するPRです。

Changes:

  • フレーバーを「ノード(sub_flavors保持)」と「設定(継承可能フィールド)」に分離し、解決時に実体(Instance)へ変換する構成へ変更
  • hooq.toml 適用処理を、親設定を子へ継承できるように更新
  • 日本語/英語ドキュメントの rustdoc_include 行番号を更新し、説明文を一部調整

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
hooq-macros/src/impls/root_attr/mod.rs Flavor から FlavorInstance 取得に追従
hooq-macros/src/impls/inert_attr/parse.rs Flavor から FlavorInstance 取得に追従
hooq-macros/src/impls/flavor/toml_load/apply.rs hooq.toml の反映ロジックを継承前提に変更
hooq-macros/src/impls/flavor/mod.rs 継承可能な設定表現(Node/Settings/Instance)へ再設計
hooq-macros/src/impls/flavor/presets/*.rs preset フレーバーを新構造(FlavorNode/FlavorSettings)に追従
docs/ja/hooq-mdbook-ja/src/reference/flavors.md ソース抜粋行番号の更新
docs/en/hooq-mdbook-en/src/reference/flavors.md ソース抜粋行番号の更新+文言調整

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 11 to 18
pub fn update_flavors(
flavors: &mut HashMap<String, Flavor>,
flavors: &mut HashMap<String, FlavorNode>,
hooq_toml: HooqToml,
) -> Result<(), String> {
update_flavor_inner(flavors, hooq_toml.flavors, &Flavor::default())?;
update_flavor_inner(flavors, hooq_toml.flavors, &FlavorSettings::default())?;

Ok(())
}
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

This change introduces non-trivial inheritance behavior between parent/sub-flavors (including preset flavors overridden via hooq.toml), but there are no tests covering it. Adding unit tests around toml_load::apply::update_flavors / FlavorStore::get_flavor for cases like overriding [log] and asserting [log.warn] inherits would help prevent regressions.

Copilot uses AI. Check for mistakes.
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.

2 participants