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,FrontendNo 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-fileisn’t passed, look for<repo>/.codelore-teams. ReturnsNoneif the file doesn’t exist. Mirrors the.codelorebotsdiscovery pattern. - load
- Load a team-map from disk. Returns an empty map if
pathisNone; callers can then callapplyunconditionally without branching.
Type Aliases§
- TeamMap
- In-memory team-map: maps the canonical author email to the team name.