-
Notifications
You must be signed in to change notification settings - Fork 0
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
Sourcery refactored master branch #1
base: master
Are you sure you want to change the base?
Conversation
next_repo = r.spop("github_repos") | ||
while next_repo: | ||
while next_repo := r.spop("github_repos"): |
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.
Function prepare
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
) - Replace call to format with f-string (
use-fstring-for-formatting
)
elif resp.status_code == 404: | ||
pass | ||
else: | ||
elif resp.status_code != 404: |
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.
Function get_email
refactored with the following changes:
- Remove empty elif clause (
remove-pass-elif
)
profile = r.spop("finished_profiles") | ||
while profile: | ||
while profile := r.spop("finished_profiles"): |
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.
Function clean_redis_set
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
)
"insert into github_leads (source_file, source_repo, gh_login, gh_id, gh_name, gh_email, gh_twitter, gh_public_repos, gh_followers, gh_created_at, gh_updated_at, raw) values ('{}', '{}', '{}', '{}', '{}', '{}', '{}', {}, {}, '{}', '{}', '{}')".format( | ||
source_file, | ||
source_repo, | ||
gh_login, | ||
gh_id, | ||
gh_name, | ||
gh_email, | ||
gh_twitter, | ||
gh_public_repos, | ||
gh_followers, | ||
gh_created_at, | ||
gh_updated_at, | ||
raw, | ||
) | ||
f"insert into github_leads (source_file, source_repo, gh_login, gh_id, gh_name, gh_email, gh_twitter, gh_public_repos, gh_followers, gh_created_at, gh_updated_at, raw) values ('{source_file}', '{source_repo}', '{gh_login}', '{gh_id}', '{gh_name}', '{gh_email}', '{gh_twitter}', {gh_public_repos}, {gh_followers}, '{gh_created_at}', '{gh_updated_at}', '{raw}')" |
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.
Function _create_new_lead
refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting
)
url = "https://api.github.com/repos/{}/stargazers?per_page=100&page={}".format( | ||
repo, page | ||
) | ||
url = f"https://api.github.com/repos/{repo}/stargazers?per_page=100&page={page}" | ||
|
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.
Function _get_star_gazers
refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting
)
github_repo_name = "{}/{}".format(main_name.split("_")[0], main_name.split("_")[1]) | ||
return github_repo_name | ||
return f'{main_name.split("_")[0]}/{main_name.split("_")[1]}' |
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.
Function _get_repo
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
) - Replace call to format with f-string (
use-fstring-for-formatting
)
if __name__ == "__main__": | ||
pass | ||
pass |
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.
Lines 180-181
refactored with the following changes:
- Remove redundant conditional (
remove-redundant-if
)
Sourcery Code Quality Report❌ Merging this PR will decrease code quality in the affected files by 1.25%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Help us improve this quality report! |
Branch
master
refactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
master
branch, then run:Help us improve this pull request!