Load all configured plugins. Return a plugin that encapsulates all plugins chained together. Always at least include the default plugin (it's last in the chain). The second return value is a snapshot of versions/hashes of loaded user plugins (for cache validation).
(
options: Options, errors: Errors, stdout: TextIO, extra_plugins: Sequence[Plugin]
)
| 725 | |
| 726 | |
| 727 | def load_plugins( |
| 728 | options: Options, errors: Errors, stdout: TextIO, extra_plugins: Sequence[Plugin] |
| 729 | ) -> tuple[Plugin, dict[str, str]]: |
| 730 | """Load all configured plugins. |
| 731 | |
| 732 | Return a plugin that encapsulates all plugins chained together. Always |
| 733 | at least include the default plugin (it's last in the chain). |
| 734 | The second return value is a snapshot of versions/hashes of loaded user |
| 735 | plugins (for cache validation). |
| 736 | """ |
| 737 | custom_plugins, snapshot = load_plugins_from_config(options, errors, stdout) |
| 738 | |
| 739 | custom_plugins += extra_plugins |
| 740 | |
| 741 | default_plugin: Plugin = DefaultPlugin(options) |
| 742 | if not custom_plugins: |
| 743 | return default_plugin, snapshot |
| 744 | |
| 745 | # Custom plugins take precedence over the default plugin. |
| 746 | return ChainedPlugin(options, custom_plugins + [default_plugin]), snapshot |
| 747 | |
| 748 | |
| 749 | def take_module_snapshot(module: types.ModuleType) -> str: |
no test coverage detected
searching dependent graphs…