|
10 | 10 | from dotenv import load_dotenv
|
11 | 11 |
|
12 | 12 | if __name__ == "__main__":
|
13 |
| - |
14 | 13 | # Load env variables from file
|
15 | 14 | dotenv_path = join(dirname(__file__), ".env")
|
16 | 15 | load_dotenv(dotenv_path)
|
|
25 | 24 | # Set the topic
|
26 | 25 | topic = os.getenv("TOPIC")
|
27 | 26 | # If multiple topics, split topics by comma
|
28 |
| - topics = [t.strip() for t in topic.split(',')] |
| 27 | + topics = [t.strip() for t in topic.split(",")] |
29 | 28 | organization = os.getenv("ORGANIZATION")
|
30 | 29 |
|
31 | 30 | # Create empty list for repos
|
32 | 31 | repo_list = []
|
33 | 32 | # Set for repos that have already been added to the list
|
34 | 33 | repo_set = set()
|
35 |
| - |
| 34 | + |
36 | 35 | # Iterate over topics, search for matching repositories, and process unique ones
|
37 | 36 | for topic in topics:
|
38 | 37 | search_string = "org:{} topic:{}".format(organization, topic)
|
39 | 38 | all_repos = gh.search_repositories(search_string)
|
40 |
| - |
| 39 | + |
41 | 40 | # For each repo in the search results, check if it's unique and add it to repo_set
|
42 | 41 | for repo in all_repos:
|
43 | 42 | if repo is not None and repo.repository.full_name not in repo_set:
|
|
59 | 58 |
|
60 | 59 | # fetch repository participation
|
61 | 60 | participation = repo.repository.weekly_commit_count()
|
62 |
| - innersource_repo["_InnerSourceMetadata"]["participation"] = participation[ |
63 |
| - "all" |
64 |
| - ] |
| 61 | + innersource_repo["_InnerSourceMetadata"][ |
| 62 | + "participation" |
| 63 | + ] = participation["all"] |
65 | 64 |
|
66 | 65 | # fetch contributing guidelines
|
67 | 66 | try:
|
|
79 | 78 | innersource_repo["_InnerSourceMetadata"]["topics"] = repo_topics.names
|
80 | 79 |
|
81 | 80 | # calculate score
|
82 |
| - innersource_repo["score"] = repo_activity.score.calculate(innersource_repo) |
| 81 | + innersource_repo["score"] = repo_activity.score.calculate( |
| 82 | + innersource_repo |
| 83 | + ) |
83 | 84 |
|
84 | 85 | repo_list.append(innersource_repo)
|
85 | 86 |
|
|
0 commit comments