diff --git a/changelogs/fragments/1-cleanup.yml b/changelogs/fragments/1-cleanup.yml new file mode 100644 index 0000000..73e989f --- /dev/null +++ b/changelogs/fragments/1-cleanup.yml @@ -0,0 +1,4 @@ +minor_changes: + - "Remove unused code (https://github.com/ansible-community/antsibull-core/pull/1)." +removed_features: + - "Remove package ``antsibull_core.utils.transformations`` (https://github.com/ansible-community/antsibull-core/pull/1)." diff --git a/src/antsibull_core/logging.py b/src/antsibull_core/logging.py index 858f4b0..9c94012 100644 --- a/src/antsibull_core/logging.py +++ b/src/antsibull_core/logging.py @@ -219,20 +219,6 @@ def run(args): mlog.debug('logging loaded') -def plugin_filter(): - """ - Filter out messages which come from plugin error output. - - :arg msg: A :twiggy:obj:`twiggy.message.Message` object which would be filtered - """ - def wrapped(msg): - return ( - msg.fields['func'] == 'write_plugin_rst' and - msg.fields['mod'] == 'antsibull.write_docs' - ) - return wrapped - - def initialize_app_logging(): """ Change log settings to make sense for an application. @@ -251,4 +237,4 @@ def initialize_app_logging(): twiggy.quick_setup(min_level=_level) -__all__ = ('log', 'initialize_app_logging', 'plugin_filter') +__all__ = ('log', 'initialize_app_logging') diff --git a/src/antsibull_core/utils/transformations.py b/src/antsibull_core/utils/transformations.py deleted file mode 100644 index 6385e20..0000000 --- a/src/antsibull_core/utils/transformations.py +++ /dev/null @@ -1,23 +0,0 @@ -# coding: utf-8 -# Author: Felix Fontein -# Author: Toshio Kuratomi -# License: GPLv3+ -# Copyright: Ansible Project, 2021 -"""General transformation functions.""" - -import typing as t -from collections import defaultdict - - -def get_collection_namespaces(collection_names: t.Iterable[str]) -> t.Dict[str, t.List[str]]: - """ - Return the plugins which are in each collection. - - :arg collection_names: An iterable of collection names. - :returns: Mapping from collection namespaces to list of collection names. - """ - namespaces = defaultdict(list) - for collection_name in collection_names: - namespace, name = collection_name.split('.', 1) - namespaces[namespace].append(name) - return namespaces