from typing import Set
import re


def scrub_tools(toolset: Set[str]) -> Set[str]:
    """tool names must conform to RFC 1123 as a DNS label
    For our purposes, they must also be no more than 54 characters in length.
    In some cases, dots are allowed, but it shouldn't be in the tool name.
    """
    dns_regex = re.compile(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$")
    return set([x for x in toolset if dns_regex.match(x) and len(x) < 54])