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

Add buffer to type completeness check #16361

Merged
merged 9 commits into from
Dec 12, 2024
Merged
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
19 changes: 14 additions & 5 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,21 @@ jobs:
BASE_SCORE=$(echo ${{ steps.calculate_base_score.outputs.base_score }})

if (( $(echo "$BASE_SCORE > $CURRENT_SCORE" | bc -l) )); then
echo "❌ Type completeness score has decreased from $BASE_SCORE to $CURRENT_SCORE" >> $GITHUB_STEP_SUMMARY
echo "Please add type annotations to your code to increase the type completeness score." >> $GITHUB_STEP_SUMMARY
echo "::notice title=Type Completeness Check::We noticed a decrease in type coverage with these changes. Check workflow summary for more details."
echo "### ℹ️ Type Completeness Check" >> $GITHUB_STEP_SUMMARY
echo "We noticed a decrease in type coverage with these changes. To maintain our codebase quality, we aim to keep or improve type coverage with each change." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Need help? Ping @desertaxle or @zzstoatzz for assistance!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Here's what changed:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
uv run scripts/pyright_diff.py prefect-analysis-base.json prefect-analysis.json >> $GITHUB_STEP_SUMMARY
exit 1
SCORE_DIFF=$(echo "$BASE_SCORE - $CURRENT_SCORE" | bc -l)
if (( $(echo "$SCORE_DIFF > 0.001" | bc -l) )); then
exit 1
fi
elif (( $(echo "$BASE_SCORE < $CURRENT_SCORE" | bc -l) )); then
echo "✅ Type completeness score has increased from $BASE_SCORE to $CURRENT_SCORE" >> $GITHUB_STEP_SUMMARY
echo "🎉 Great work! The type coverage has improved with these changes" >> $GITHUB_STEP_SUMMARY
else
echo "✅ Type completeness score remained unchanged at $BASE_SCORE" >> $GITHUB_STEP_SUMMARY
echo "✅ Type coverage maintained" >> $GITHUB_STEP_SUMMARY
fi
1 change: 0 additions & 1 deletion scripts/pyright_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def compare_pyright_outputs(base_file: str, new_file: str) -> None:
# Find new errors
new_errors = list(new_diags - base_diags)

print("\n## New Pyright Errors\n")
print(format_markdown_table(new_errors))


Expand Down
Loading