Improve Type Completeness & Corresponding Workflow (#4035)

This commit is contained in:
Bibo-Joshi 2023-12-29 22:48:45 +01:00 committed by GitHub
parent a52c91996e
commit 57c2f6e01e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -50,6 +50,14 @@ jobs:
json.load(open("pr.json", "rb"))["typeCompleteness"]["completenessScore"] json.load(open("pr.json", "rb"))["typeCompleteness"]["completenessScore"]
) )
base_text = f"This PR changes type completeness from {round(base, 3)} to {round(pr, 3)}." base_text = f"This PR changes type completeness from {round(base, 3)} to {round(pr, 3)}."
if base == 0:
text = f"Something is broken in the workflow. Reported type completeness is 0. 💥"
set_summary(text)
print(Path("pr.readable").read_text(encoding="utf-8"))
error(text)
exit(1)
if pr < (base - 0.001): if pr < (base - 0.001):
text = f"{base_text} ❌" text = f"{base_text} ❌"
set_summary(text) set_summary(text)

View file

@ -105,7 +105,7 @@ class JobQueue(Generic[CCT]):
self._application: Optional[weakref.ReferenceType[Application]] = None self._application: Optional[weakref.ReferenceType[Application]] = None
self._executor = AsyncIOExecutor() self._executor = AsyncIOExecutor()
self.scheduler: AsyncIOScheduler = AsyncIOScheduler(**self.scheduler_configuration) self.scheduler: "AsyncIOScheduler" = AsyncIOScheduler(**self.scheduler_configuration)
def __repr__(self) -> str: def __repr__(self) -> str:
"""Give a string representation of the JobQueue in the form ``JobQueue[application=...]``. """Give a string representation of the JobQueue in the form ``JobQueue[application=...]``.