Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(config): best effort resolution for circurlar dependencies #154

Merged
merged 1 commit into from
Sep 21, 2017
Merged

feat(config): best effort resolution for circurlar dependencies #154

merged 1 commit into from
Sep 21, 2017

Conversation

kionz
Copy link
Contributor

@kionz kionz commented Sep 20, 2017

to fix the reported issue in #150 (comment)

Copy link
Member

@lotem lotem left a comment

Choose a reason for hiding this comment

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

LGTM

@osfans 也幫忙測試一下吧,沒問題就可以 rebase & merge

static bool HasCircularDependencies(ConfigDependencyGraph* graph,
const string& path) {
for (const auto& x : graph->resolve_chain) {
if (boost::starts_with(x, path) &&
Copy link
Member

Choose a reason for hiding this comment

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

path 的字符串比較,對 map 有效,list index 則除了數值還有關鍵字寫法,如 @last。所以這個檢查不夠完全。

Copy link
Member

Choose a reason for hiding this comment

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

暫時想不出來萬全的做法。先用用看。

@@ -0,0 +1,8 @@
test:
__include: sometimes?
home: excited
Copy link
Member

Choose a reason for hiding this comment

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

我覺得例子這樣寫可以更好地描述行爲:
通過 patch 修改 test/home 的值,然後測試 test/work 引用了 patch 之前的值。

@lotem lotem merged commit 2e52d54 into rime:master Sep 21, 2017
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