Skip to main content

Module team_map

Module team_map 

Expand description

Team-map projection: optional author,team CSV that aliases author identities to logical teams at ingest time. Mirrors code-maat’s -p / --team-map-file flag. Applied AFTER mailmap normalization and AFTER bot filtering — the input is the already-canonical author email; the output is either the matched team name or the email unchanged.

Format: a simple two-column CSV with a required header row.

author,team
alice@example.com,Backend
bob@example.com,Frontend

No quoting support today — the parser splits on the first comma per line. Author identities with commas in them are not supported (none exist in any real-world repo we know of). This matches code-maat’s own implementation, which uses a similarly naive parser.

Functions§

apply
Apply the team-map to a single author. Unmatched authors pass through unchanged (matches code-maat’s (get team-lookup author author) fallback).
discover
Auto-discovery: if --team-map-file isn’t passed, look for <repo>/.codelore-teams. Returns None if the file doesn’t exist. Mirrors the .codelorebots discovery pattern.
load
Load a team-map from disk. Returns an empty map if path is None; callers can then call apply unconditionally without branching.

Type Aliases§

TeamMap
In-memory team-map: maps the canonical author email to the team name.