Particular taskotron task

    With this rule, you can limit messages to only those of particular
    `taskotron <https://taskotron.fedoraproject.org/>`_ task.

    You can specify several tasks by separating them with a comma ',',
    i.e.: ``dist.depcheck,dist.rpmlint``.

def taskotron_task(config, message, task=None):
    """ Particular taskotron task

    With this rule, you can limit messages to only those of particular
    `taskotron <https://taskotron.fedoraproject.org/>`_ task.

    You can specify several tasks by separating them with a comma ',',
    i.e.: ``dist.depcheck,dist.rpmlint``.
    """

    # We only operate on taskotron messages, first off.
    if not taskotron_result_new(config, message):
        return False

    if not task:
        return False

    tasks = [item.strip().lower() for item in task.split(',')]
    return message['msg']['task'].get('name').lower() in tasks