Skip to content

refactor suggestion #382

Description

@hannesdelbeke

PS: while working on #380, i noticed discover and registering a plugin directly have a lot of overlapping code.

both

  • def plugins_from_module(module)
  • def register_plugin(plugin)

contain

  • host_is_compatible()
  • version_is_compatible
  • plugin_is_valid

But there are differences:

  • register_plugin checks if if not hasattr(plugin, "__call__"):
  • plugins_from_module doesn't

since all of these functions check if a plugin is valid, is it a bad suggestion to move them to the plugin_is_valid function?
will create a PR with a suggestion once 380 is merged in

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions