import fnmatch
import os
from collections.abc import Generator


def glob(path: str, base: str) -> Generator[str]:
    """
    glob.glob ignores hidden files. this one allows them, and matches against the relative path provided in the config.

    :param path: string or wildcard that represents one or more files
    :param base: base directory to run the relative path search in
    :returns: generator of filenames in the current directory that matched
    """
    for root, _dirs, files in os.walk(base):
        for fname in files:
            full = os.path.normpath(os.path.join(root, fname).replace(base, "."))
            if fnmatch.fnmatch(full, path):
                yield full
