def match_file(filename):
    """Return True if file is okay for modifying/recursing."""
    base_name = os.path.basename(filename)

    if base_name.startswith('.'):
        return False

    if not os.path.isdir(filename) and not filename.lower().endswith('.rst'):
        return False

    return True
Return True if file is okay for modifying/recursing.