Small, easy to use, easy to install tool to lint your git mailmap
- Mailmap file (.mailmap) must exist
- Mailmap must be sorted
- All authors in git history must be mapped
- All authors must conform to:
Name FamilyName <[email protected]> - Exclude file (.mailmap-exclude). Optional.
.mailmap-excludecan contain a list of regular expressions (or be empty) to exclude from the.mailmapfile --excludeor-eargument. Optional.mailmap-linter --exclude 'regex'If the excludes aren't too many then use--excludeinstead of the exclude file, ex:mailmap-linter --exclude '^.* <.*[email protected]>$'
Given you've installed Nix (https://nixos.org/nix/download.html)
Run the following command:
$ nix-env -i -f https://github.com/kamadorueda/mailmap-linter/archive/master.tar.gzRun from the root of the repository that you want to lint:
$ mailmap-linterExclude with regex:
$ mailmap-linter --exclude '...'Use Nixos/nix as the base image for your Job: https://hub.docker.com/r/nixos/nix
Then install and use the same commands for the local build
$ mailmap-linter
[INFO] Verifying if .mailmap exists
[INFO] Verifying if .mailmap-exclude exists
[INFO] Computing contributors
[INFO] Reading current .mailmap
[INFO] Reading current .mailmap-exclude
[INFO] Verifying .mailmap format
[INFO] Verifying that every author is in the .mailmap
[INFO] Verifying: GitHub <[email protected]>
[INFO] Excluded: GitHub <[email protected]>
[INFO] Verifying: Kevin Amado <[email protected]>
[INFO] Verifying: Robin Quintero <[email protected]>
[INFO] Verifying: Timothy DeHerrera <[email protected]>
[INFO] Verifying that .mailmap is sorted
[INFO] OK