Skip to content

Commit

Permalink
Merge pull request #20 from ghinks/feat/all-languages
Browse files Browse the repository at this point in the history
feat: all languages
  • Loading branch information
ghinks authored Dec 23, 2024
2 parents a7b51bb + ae6ef78 commit d29116b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions pr_reviews/cli/parse_cmd_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ def parse_cmd_line() -> [str, datetime, datetime, list[str]]:
print("Error: Start date must be before end date") # noqa: T201
sys.exit(1)
# if the language arg has comma separated values, split them
languages = [args.language]
if args.language and "," in args.language:
if args.language is None:
languages = []
elif args.language and "," in args.language:
languages = args.language.split(",")
else:
languages = [args.language]
return args.org, start_date, end_date, languages
6 changes: 4 additions & 2 deletions pr_reviews/queries/get_repos_gql.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def get_repos_by_language(org: str, languages: list[str]) -> list[str]:
return [
repo["name"]
for repo in data["data"]["organization"]["repositories"]["nodes"]
for node in repo["languages"]["nodes"]
if node["name"].lower() in [language.lower() for language in languages]
if not languages or any(
node["name"].lower() in
[language.lower() for language in languages]
for node in repo["languages"]["nodes"])
]

0 comments on commit d29116b

Please sign in to comment.