Skip to content

Commit

Permalink
Increase Verbosity of Type Completeness CI Job (#3531)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bibo-Joshi committed Feb 4, 2023
1 parent a0f98b2 commit bacdeb3
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/type_completeness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,36 @@ jobs:
git checkout ${{ github.head_ref }}
pip install . -U
pyright --verifytypes telegram --ignoreexternal --outputjson > pr.json || true
pyright --verifytypes telegram --ignoreexternal > pr.readable || true
- name: Compare Completeness
uses: jannekem/run-python-script-action@v1
with:
script: |
import json
import os
from pathlib import Path
base = float(
json.load(open("base.json", "rb"))["typeCompleteness"]["completenessScore"]
)
pr = float(
json.load(open("pr.json", "rb"))["typeCompleteness"]["completenessScore"]
)
base_text = f"After this PR, type completeness will be {round(pr, 3)}."
if pr < (base - 0.1):
text = f"This PR decreases type completeness by {round(base - pr, 3)} ❌"
text = f"This PR decreases type completeness by {round(base - pr, 3)}. ❌"
set_summary(text)
error(text)
print(Path("pr.readable").read_text(encoding="utf-8"))
error(f"{text}\n{base_text}")
exit(1)
elif pr > (base + 0.1):
text = f"This PR increases type completeness by {round(pr - base, 3)} ✨"
text = f"This PR increases type completeness by {round(pr - base, 3)}. ✨"
set_summary(text)
print(text)
if pr < 1:
print(Path("pr.readable").read_text(encoding="utf-8"))
print(f"{text}\n{base_text}")
else:
text = f"This PR does not change type completeness by more than 0.1 ✅"
text = f"This PR does not change type completeness by more than 0.1. ✅"
set_summary(text)
print(text)
print(Path("pr.readable").read_text(encoding="utf-8"))
print(f"{text}\n{base_text}")

0 comments on commit bacdeb3

Please sign in to comment.