forked from conda/conda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcla_check.py
102 lines (84 loc) · 2.14 KB
/
cla_check.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
from subprocess import check_output
contributors = sorted(set(x.strip('"') for x in check_output(
['git', 'log', '--format="%aN <%aE>"']
).decode("utf-8").splitlines()))
with open('.cla-signers') as fh:
github_map_lines = fh.read().strip().split('\n')
def get_cla_signers():
with open('.cla-signers') as fh:
for line in fh:
line = line.strip()
if line.startswith('#') or not line:
continue
yield line
signers_map = {}
for line in get_cla_signers():
username, contributor_name, _ = line.split('|')
username = username.strip()
contributor_name = contributor_name.strip()
if username:
signers_map[contributor_name] = username
def get_github_map_line():
with open('.github-map') as fh:
for line in fh:
line = line.strip()
if line.startswith('#') or not line:
continue
github_username, git_id = line.split('|')
yield git_id.strip(), github_username.strip()
github_username_map = dict(x for x in get_github_map_line())
sent = [
"alanhdu",
"arkottke",
"almarklein",
"groutr",
"delicb",
"chrislf",
"dan-blanchard",
"Horta",
"dhirschfeld",
"dfroger",
"dawehner",
"dedalusj",
"e-gillies-ix",
"3kwa",
"faph",
"flaviomartins",
"aldanor",
"jacoblsmith",
"jrovegno",
"jbcrail",
"jerowe",
"kdeldycke",
"Korijn",
"mikecroucher",
"blindgaenger",
"mdengler",
"melund",
"megies",
"mheilman",
"elehcim",
"mika-fischer",
"natefoo",
"nickeubank",
"rcthomas",
"remram44",
"rleecivis",
"tdhopper",
"twiecki",
"tpn",
"ukoethe",
"esc",
"NewbiZ",
"wojdyr",
"wulmer",
]
for contributor in contributors:
if contributor not in signers_map:
github_username = github_username_map[contributor]
if github_username not in sent:
print(contributor)