-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add a new global plugin API. #311
Conversation
JaCoCo Code Coverage 79.53% ✅
Generated by 🚫 Danger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only few nits
for (inspector in inspectors) { | ||
inspector.onFormulaStarted(formulaType) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe introduce private fun forEveryInspector(block: Inspector.() -> Unit)
to make this class less verbose and a little more kt idiomatic?
forEveryInspector { onFormulaStarted(formulaType) }
val globalInspector = TestInspector() | ||
FormulaPlugins.setPlugin(object : Plugin { | ||
override fun inspector(type: KClass<*>): Inspector { | ||
return globalInspector | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should we have test cases for any possible (global, local) permutation, not only when both are not null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have some tests for local only, added a new test for global only.
What
Enable global introspection via a plugins API.