Hmbown/CodeWhale · error · ValueError

{path}:{lineno}: expected 'alias = Name <email>'

Error message

{path}:{lineno}: expected 'alias = Name <email>'

What it means

Each non-empty, non-comment line of .github/AUTHOR_MAP must be 'alias = Name <email>'. This error is raised while loading the map when a line contains no '=' separator at all, with the file path and 1-based line number of the bad line.

Source

Thrown at scripts/check-coauthor-trailers.py:149

    match = IDENTITY_RE.match(raw)
    if not match:
        raise ValueError(f"{context}: expected 'Name <id+login@users.noreply.github.com>'")
    identity = Identity(match.group("name").strip(), match.group("email").strip())
    if not CANONICAL_NOREPLY_RE.match(identity.email):
        raise ValueError(
            f"{context}: right-hand email must be numeric GitHub noreply, got {identity.email}"
        )
    return identity


def load_author_map(path: Path) -> dict[str, Identity]:
    aliases: dict[str, Identity] = {}
    for lineno, raw_line in enumerate(path.read_text(encoding="utf-8").splitlines(), start=1):
        line = raw_line.split("#", 1)[0].strip()
        if not line:
            continue
        if "=" not in line:
            raise ValueError(f"{path}:{lineno}: expected 'alias = Name <email>'")
        alias, raw_identity = [part.strip() for part in line.split("=", 1)]
        identity = parse_identity(raw_identity, f"{path}:{lineno}")
        key = norm_key(alias)
        if key in aliases and aliases[key] != identity:
            raise ValueError(f"{path}:{lineno}: duplicate alias {alias!r}")
        aliases[key] = identity
        aliases.setdefault(norm_key(identity.email), identity)
        aliases.setdefault(norm_key(identity.name), identity)
        if login := github_login_from_noreply(identity.email):
            aliases.setdefault(norm_key(login), identity)
    return aliases


def git_log(commit_range: str) -> list[Commit]:
    try:
        raw = subprocess.check_output(
            [
                "git",

View on GitHub (pinned to 8880682c63)

Solutions

  1. Open .github/AUTHOR_MAP at the reported line and rewrite it as 'alias = Name <id+login@users.noreply.github.com>'.
  2. Move any explanatory text into a '#' comment line.
  3. Resolve leftover merge-conflict markers in the file.
  4. Validate with a quick run: python3 scripts/check-coauthor-trailers.py <range> before pushing.

Example fix

# before (line 12 of .github/AUTHOR_MAP)
Jane Doe <1234567+janedoe@users.noreply.github.com>
# after
jane = Jane Doe <1234567+janedoe@users.noreply.github.com>
Defensive patterns

Strategy: validation

Validate before calling

def map_line_is_assignment(line: str) -> bool:
    line = line.split("#", 1)[0].strip()
    return (not line) or ("=" in line)

Prevention

When it happens

Trigger: A map line like 'Jane Doe <1234+jane@users.noreply.github.com>' (identity without alias), a free-text note left in the file, or a line where '=' was replaced by ':' or omitted. Comments after '#' and blank lines are allowed; everything else must be an assignment.

Common situations: Hand-edits to AUTHOR_MAP that paste a raw identity instead of an alias mapping; documenting entries with prose lines instead of '#'-comments; merge conflicts leaving conflict markers ('<<<<<<<') that contain no '='.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16). Data as JSON: /api/errors/fe83f9d6bb70affb. Report an issue: GitHub.