Repository navigation
Special cases #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Special cases #25
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,25 @@ | ||||||||||||||||
| # Special cases where we consider the CLA to be signed, | ||||||||||||||||
| # although the username on the commit doesn't match contributors.json. | ||||||||||||||||
|
|
||||||||||||||||
| philip_durbin # "pdurbin" is in contributors.json. | ||||||||||||||||
| raman_prasad # "raprasad" is in contributors.json. | ||||||||||||||||
| ethan24 # "ecowan" is in contributors.json. | ||||||||||||||||
| damienbfs # "TedTed" is in contributors.json. | ||||||||||||||||
|
|
||||||||||||||||
| # User w/o CLA: lines | ||||||||||||||||
| # | ||||||||||||||||
| # abigail-gentle: 380 | ||||||||||||||||
| # No response from Abigail Gentle. | ||||||||||||||||
| # matchaginseng: 156 | ||||||||||||||||
| # No email for Vicki Xu. | ||||||||||||||||
| # orespo: 140 | ||||||||||||||||
| # No email for Oren ___. | ||||||||||||||||
| # chle: 80 | ||||||||||||||||
| # CLA signed by university representative: Peter Sestoft, Martin Zachariasen, or Jens Christian Godskesen depending on the date. | ||||||||||||||||
| # Review old emails? | ||||||||||||||||
| # abuahchu: 24 | ||||||||||||||||
| # No response from Chike Abuah. | ||||||||||||||||
| # roykoand: 9 | ||||||||||||||||
| # No email for Andrii Roiko. | ||||||||||||||||
|
Comment on lines
+22
to
+23
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
| # fefealzueta: 5 | ||||||||||||||||
| # No email for ___. | ||||||||||||||||
|
Comment on lines
+24
to
+25
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Email is fefealzueta@gmail.com
Suggested change
|
||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| from pathlib import Path | ||
| from subprocess import check_output | ||
| from os import chdir | ||
| import re | ||
| from collections import Counter | ||
| from json import loads | ||
|
|
||
|
|
||
| def get_blame(blame_path): | ||
| chdir("/tmp") | ||
| path = Path("opendp") | ||
| if not path.exists(): | ||
| check_output("git clone https://github.com/opendp/opendp.git".split(" ")) | ||
| chdir("opendp") | ||
| blames = [] | ||
| for root, dirs, files in Path(".").walk(): | ||
| for file in files: | ||
| file_path = root/file | ||
| if str(file_path).startswith('.git/'): | ||
| # Fresh checkout, so shouldn't have any generated files to ignore. | ||
| continue | ||
| print(file_path) | ||
| if file_path.is_dir(): | ||
| continue | ||
| try: | ||
| blame = check_output(f"git blame --show-email {file_path}".split(" "), text=True) | ||
| except UnicodeDecodeError: | ||
| continue | ||
| blames += [f"{file_path}: {line}" for line in blame.splitlines()] | ||
| chdir("..") | ||
| blame_path.write_text("\n".join(blames)) | ||
|
|
||
|
|
||
| def get_counts(): | ||
| chdir("/tmp") | ||
| blame_path = Path("opendp.blame") | ||
| if not blame_path.exists(): | ||
| get_blame(blame_path) | ||
| blame = blame_path.read_text().splitlines() | ||
| counts = Counter() | ||
| for line in blame: | ||
| m = re.match(r'^([^:]+): [0-9a-f^]{9}(?: [^(]+)? \(<(?:\d+\+)?([^@]+)', line) | ||
| if m: | ||
| file = m.group(1) | ||
| user = m.group(2).lower() | ||
| counts[user] += 1 | ||
| else: | ||
| raise Exception(f'No match: {line}') | ||
| return counts | ||
|
|
||
|
|
||
| def get_contrib(): | ||
| contributors_json = (Path(__file__).parent.parent / 'contributors.json').read_text() | ||
| contributors = [c.lower() for c in loads(contributors_json)] | ||
| return contributors | ||
|
|
||
|
|
||
| def get_special(): | ||
| special_txt = (Path(__file__).parent.parent / 'contributors-special.txt').read_text() | ||
| contributors = [uncomment for line in special_txt.splitlines() if (uncomment := line.split('#')[0].strip())] | ||
| return contributors | ||
|
|
||
| def main(): | ||
| counts = get_counts() | ||
| contributors = get_contrib() | ||
| specials = get_special() | ||
| for c in contributors: | ||
| del counts[c] | ||
| for s in specials: | ||
| del counts[s] | ||
| for (k, v) in counts.most_common(): | ||
| print(f"{k}: {v}") | ||
|
|
||
| if __name__ == '__main__': | ||
| main() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.