Skip to content
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 main branch #1

Merged
merged 2 commits into from
Jun 14, 2023
Merged

Sourcery refactored main branch #1

merged 2 commits into from
Jun 14, 2023

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Jun 13, 2023

Branch main 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 main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from Advik-B June 13, 2023 16:11
token = os.getenv("GH_TOKEN")
if token:
if token := os.getenv("GH_TOKEN"):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function auth_to_github refactored with the following changes:

Comment on lines -86 to +85
time_to_first_response = None
return None
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function measure_time_to_first_response refactored with the following changes:

Comment on lines -120 to +117
time_to_close = closed_at - created_at

return time_to_close
return closed_at - created_at
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function measure_time_to_close refactored with the following changes:

Comment on lines -238 to +234
[issue.time_to_close for issue in issues_with_time_to_close], timedelta()
(issue.time_to_close for issue in issues_with_time_to_close),
timedelta(),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_average_time_to_close refactored with the following changes:

Comment on lines -302 to 319
if issue.state == "open": # type: ignore
num_issues_open += 1
if issue.state == "closed": # type: ignore
if issue.state == "closed":
num_issues_closed += 1
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function main refactored with the following changes:

  • Simplify conditional into switch-like form (switch)

Comment on lines -331 to -354
repo_url = os.getenv("REPOSITORY_URL")
if not repo_url:
if repo_url := os.getenv("REPOSITORY_URL"):
return search_query, repo_url
else:
raise ValueError("REPOSITORY_URL environment variable not set")
return search_query, repo_url
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_env_vars refactored with the following changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant