diff --git a/flake8/plugins/manager.py b/flake8/plugins/manager.py index aba5f16..c453dbe 100644 --- a/flake8/plugins/manager.py +++ b/flake8/plugins/manager.py @@ -35,6 +35,7 @@ class Plugin(object): self.name = name self.entry_point = entry_point self._plugin = None + self._parameters = None def __repr__(self): """Provide an easy to read description of the current plugin.""" @@ -42,6 +43,13 @@ class Plugin(object): self.name, self.entry_point ) + @property + def parameters(self): + """List of arguments that need to be passed to the plugin.""" + if self._parameters is None: + self._parameters = utils.parameters_for(self) + return self._parameters + @property def plugin(self): """The loaded (and cached) plugin associated with the entry-point. @@ -303,8 +311,7 @@ class Checkers(PluginTypeManager): Find all checker plugins that are expecting a specific argument. """ for plugin in self.plugins.values(): - parameters = utils.parameters_for(plugin) - if argument_name == parameters[0]: + if argument_name == plugin.parameters[0]: yield plugin @property