-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
v0.8 release #253
Comments
Plugin's API reconsideration is probably required becasuse |
Apologies for my delayed response (summer vacation). This sounds like a sensible plan to me :) @skjdbg Would you like to do this? If not, I'm happy to. |
Sure, I'll do it tomorrow but, unless I missed a feature of Rust, we can't make enums of traits, can we ? So I think it should look like this: Vec<Rule> with enum Rule {
TextRule(*mut dyn TextRule),
SyntaxRule(*mut dyn TextRule)
} |
Pretty much, yes. |
It seems you've already done it all. Should I pull your changes in #251 and dalance/svlint-plugin-sample#5 ? Also, wouldn't it be more practical to have each trait have a default implementation for its conversion to I'm thinking about something like this : pub trait TextRule: Sync + Send {
fn check(&mut self, text: &str, config: &ConfigOption) -> TextRuleResult;
fn name(&self) -> String;
fn hint(&self, config: &ConfigOption) -> String;
fn reason(&self) -> String;
fn into_rule(self) -> Rule
where
Self: Sized + 'static,
{
let temp = Box::new(self);
Rule::Text(Box::into_raw(temp))
}
} and on the plugin's side: pub extern "C" fn get_plugin() -> Vec<Rule> {
combine_rules!(
SamplePlugin,
AnotherPlugin,
)
}
#[macro_export]
macro_rules! combine_rules {
( $( $x:ty ),* $(,)? ) => {
{
let mut vec: Vec<Rule> = Vec::new();
$(
let rule = <$x>::default();
vec.push(rule.into_rule());
)*
vec
}
};
} |
Not quite yet! I'm still working on a test infrastructure that exercises the new API. Fine to pull my changes into your PRs, but perhaps wait for the test infrastructure commits before merging (I'll mention this issue in the commit message). |
Good idea :) It would be nice to have the macro exported from svlint though. Perhaps named |
Thanks @skjdbg (dalance/svlint#253 (comment)) Also fix warning by using result of `linter.load()`.
@skjdbg I've made those changes to the pair of branches (but there's no TextRule sample). |
I don't mind, you can go ahead and open them. If you want an example of TextRule, how about forbidding uppercase characters ? Might as well add it from the get go, so nobody thinks a plugin can only have one kind of |
@dalance I think the PRs are in place now - #255, and dalance/svlint-plugin-sample#7 (will wait for v0.8.0 release before changing from draft to proper). |
Nice one man :) I think ready. |
I think it's good to go too! |
I released v0.8.0. |
Nice one :) I've updated the corresponding PR (dalance/svlint-plugin-sample#7) and made it ready for review/merge. |
Today, I merged #247.
I want to bump up version to v0.8 because this PR has big changes.
In addition, I want to include #248/#251 in this release because it has a breaking change of plugin binray ABI.
I think there are the following items to do.
svlint v0.8 release
after release
Rule
->SyntaxRule
. svlint-plugin-sample#3@DaveMcEwan @skjdbg
Is there any idea or suggestion?
The text was updated successfully, but these errors were encountered: