comeback icon indicating copy to clipboard operation
comeback copied to clipboard

[CODE] Plugin as a class

Open yoavgolan opened this issue 5 years ago • 4 comments

Creating a Plugin class will help create:

  • logical inheritance of plugins (like: Plugin->IdePlugin->PycharmPlugin)
  • clear and enforceable interface for a plugin (like: run, check etc...)
  • common code for all plugins (for example: Determining the OS and running the correct run function)

yoavgolan avatar Mar 02 '19 21:03 yoavgolan

This is a great idea! I like your second and third points the most. PS, if you have time 🤞, you are welcome to work on it. Here, you are awesome in any case.

agamm avatar Mar 02 '19 21:03 agamm

What do you think about keeping the run_plugin and having the class, so people could choose if they want to use classes or not? or will it make a mess? @yammesicka @yoavgolan

agamm avatar Mar 02 '19 21:03 agamm

Maybe we can add some @shitty_decorator that will wrap functions to make it compatible :)

@look_at_me_im_a_plugin_class
def run_plugin(params):
    pass

yammesicka avatar Mar 02 '19 21:03 yammesicka

Maybe we can add some @shitty_decorator that will wrap functions to make it compatible :)

@look_at_me_im_a_plugin_class
def run_plugin(params):
    pass

That's cool. That way we keep both ways working, right?

agamm avatar Mar 02 '19 21:03 agamm