def METHOD_NAME(
    cfg: Config, path: Path, ignore_paths: set[Path], lintfunc: LintFunc
) -> int:
    if not path.is_dir():
        raise ValueError("Unexpected path argument: expected to be a directory")
    errcount = 0
    for dentry in path.iterdir():
        if dentry.stem.startswith("."):
            if cfg.debug:
                click.echo(f"> Skipping hidden directory entry {dentry}")
            continue
        if dentry.absolute() in ignore_paths:
            if cfg.debug:
                click.echo(f"> Skipping ignored directory entry {dentry}")
            continue
        if dentry.is_dir():
            errcount += METHOD_NAME(cfg, dentry, ignore_paths, lintfunc)
        else:
            errcount += _lint_file(cfg, dentry, lintfunc)
    return errcount