pyblish / pyblish-base

Pyblish base library - see https://github.com/pyblish/pyblish for details.
Other
127 stars 59 forks source link

refactor suggestion #382

Open hannesdelbeke opened 2 years ago

hannesdelbeke commented 2 years ago

PS: while working on https://github.com/pyblish/pyblish-base/pull/380, i noticed discover and registering a plugin directly have a lot of overlapping code.

both

contain

But there are differences:

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

hannesdelbeke commented 2 years ago

see PR https://github.com/pyblish/pyblish-base/pull/386 with suggested changes would also give a more accurate overview of coverage. several if statements in discover are not triggered, yet since the function has a test it is 100% covered...