-
-
Notifications
You must be signed in to change notification settings - Fork 241
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
Add Hacktoberfest user stats cog #7
Conversation
bot/cogs/hacktoberstats.py
Outdated
|
||
Otherwise, return None | ||
""" | ||
queryURL = f"https://api.github.com/search/issues?q=-label:invalid+type:pr+is:public+author:{username}+created:2018-10-01..2018-10-31&per_page=300" |
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.
Can this be split into multiple lines? maybe one new line for each new filter on the search.
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.
Something like:
base_url = "https://api.github.com/search/issues?q="
not_label = "invalid"
action_type = "pr"
is_query = f"public+author:{username}"
date_range = "2018-10-01..2018-10-31"
per_page = "300"
query_url = f"{base_url}-label:{not_label}+type:{action_type}+is:{is_query}+created:{date_range}&per_page={per_page}"
Or should I go with a concatenated multi-line string?
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.
Great PR! Just needs some cleaning up for readability, particularly lowercase variable, argument and method names.
Might want to run this through flake8 to clear up some of the syntactical errors I missed in the reviews. |
Adjust variable & function names to be more in line with PEP8's recommendations. Break API query URL into multiple parts to aid readability and customization Adjust command input to explicitly accept a username input rather than star packing & unpacking. d.py guards against too many inputs for us Change _getURL to _get_shortname and adjust documentation because we're not even doing what the function name and documentation said we were
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.
Looks good!
Spoooooky
See: Casper, the Friendly Ghost
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.
well that's just nice isn't it.
Initial functionality for #6 for review.
There are a few typos to fix but they'll be squashed in with changes from review.