Skip to content
This repository was archived by the owner on Jul 12, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions astropy_bot/copyedit_checker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from baldrick.plugins.github_pull_requests import pull_request_handler


# TODO: we need to note somewhere that if the copyeditor changes, this needs to
# be updated!
COPYEDITOR_GH_HANDLE = 'lglattly'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe this can be a configurable item in pyproject.toml? If other packages decides to deploy this in their own repo, you don't want lglattly to get spammed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

haha! Right.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Although, it might be a way to get @lglattly some more work ;)



@pull_request_handler
def check_copyedit_docs(pr_handler, repo_handler):
statuses = {}

if 'docs' in pr_handler.labels:
if 'copyedited' in pr_handler.labels:
statuses['copyedit'] = {
'description': "This PR has been copyedited.",
'state': 'success'
}

else:
statuses['copyedit'] = {
'description': "This PR modifies the documentation and is "
"waiting for copyediting. No action is needed "
"from the contributor.",
'state': 'failure'
}

else:
return None

if COPYEDITOR_GH_HANDLE not in pr_handler.json['assignees']:
pr_handler.add_assignees(COPYEDITOR_GH_HANDLE)

return statuses
1 change: 1 addition & 0 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

# Load astropy-specific plugins
import astropy_bot.changelog_checker # noqa
import astropy_bot.copyedit_checker # noqa

# Bind to PORT if defined, otherwise default to 5000.
port = int(os.environ.get('PORT', 5000))
Expand Down