-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#4 Check done pull request are closed
- Loading branch information
Showing
6 changed files
with
143 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from check_done.done_project_items_info.done_project_items_info import done_project_items_info | ||
from check_done.done_project_items_info.info import ProjectItemInfo | ||
|
||
|
||
def check_done_issues_for_warnings() -> list[str | None]: | ||
result = [] | ||
done_issues = done_project_items_info() | ||
criteria_checks = [ | ||
_check_done_issues_are_closed, | ||
] | ||
for issue in done_issues: | ||
warnings = [check(issue) for check in criteria_checks if check(issue)] | ||
result.extend(warnings) | ||
return result | ||
|
||
|
||
def _check_done_issues_are_closed(issue: ProjectItemInfo) -> str | None: | ||
result = None | ||
if not issue.closed: | ||
result = _issue_warning_string( | ||
issue, | ||
"closed", | ||
) | ||
return result | ||
|
||
|
||
def _issue_warning_string(issue: ProjectItemInfo, reason_for_warning: str) -> str: | ||
# TODO: Ponder better wording. | ||
return ( | ||
f" Done project item should be {reason_for_warning}." | ||
f" - repository: '{issue.repository.name}', project item: '#{issue.number} {issue.title}'." | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.