forked from csabella/pulls
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat(*): Show PR title on hover over PR number (#3)
- Loading branch information
1 parent
8f4be4c
commit a0748d2
Showing
6 changed files
with
63 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,22 +1,25 @@ | ||
from collections import defaultdict | ||
|
||
|
||
def pr_by_file(pull_requests): | ||
def get_files(pull_requests): | ||
files = defaultdict(set) | ||
for pr in pull_requests: | ||
for file in pr['files']['nodes']: | ||
filename = file['path'] | ||
files[filename].add(pr['number']) | ||
return files | ||
|
||
|
||
def change_values_to_list(pull_requests): | ||
files = pr_by_file(pull_requests) | ||
for filename, pr in files.items(): | ||
files[filename] = list(pr) | ||
files[filename].sort() | ||
files = dict(sorted(files.items())) | ||
return files | ||
results = dict() | ||
for file_name in files.keys(): | ||
if not file_name.startswith('Misc'): | ||
results[file_name] = files[file_name] | ||
return results | ||
|
||
|
||
def main(pull_requests): | ||
return change_values_to_list(pull_requests) | ||
def get_titles(pull_requests): | ||
pr_titles = dict() | ||
for pr in pull_requests: | ||
pr_titles.update({pr['number']: pr['title']}) | ||
return pr_titles |
This file contains 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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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