mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:04 +00:00
[red-knot] mypy_primer: pipeline improvements (#16620)
## Summary - Add comment to explain `sed` command - Fix double reporting of diff - Hide (large) diffs in `<details>`
This commit is contained in:
parent
da069aa00c
commit
0af4985067
2 changed files with 12 additions and 2 deletions
10
.github/workflows/mypy_primer.yaml
vendored
10
.github/workflows/mypy_primer.yaml
vendored
|
@ -61,16 +61,22 @@ jobs:
|
|||
echo "Running mypy_primer"
|
||||
|
||||
(
|
||||
uvx --from "git+https://github.com/astral-sh/mypy_primer.git@add-red-knot-support" mypy_primer \
|
||||
uvx --verbose --from "git+https://github.com/astral-sh/mypy_primer.git@add-red-knot-support" mypy_primer \
|
||||
--repo ruff \
|
||||
--type-checker knot \
|
||||
--old base_commit \
|
||||
--new "$GITHUB_SHA" \
|
||||
--project-selector '/(mypy_primer|black|pyp|git-revise|zipp|arrow)$' \
|
||||
--output concise \
|
||||
--debug | tee /dev/stdout | sed -e 's/\x1b\[[0-9;]*m//g' > mypy_primer.diff
|
||||
--debug > mypy_primer.diff
|
||||
) || [ $? -eq 1 ]
|
||||
|
||||
# Output diff with ANSI color codes
|
||||
cat mypy_primer.diff
|
||||
|
||||
# Remove ANSI color codes before uploading
|
||||
sed -ie 's/\x1b\[[0-9;]*m//g' mypy_primer.diff
|
||||
|
||||
echo ${{ github.event.number }} > pr-number
|
||||
|
||||
- name: Upload diff
|
||||
|
|
4
.github/workflows/mypy_primer_comment.yaml
vendored
4
.github/workflows/mypy_primer_comment.yaml
vendored
|
@ -63,9 +63,13 @@ jobs:
|
|||
|
||||
echo '## `mypy_primer` results' >> comment.txt
|
||||
if [ -s "pr/mypy_primer_diff/mypy_primer.diff" ]; then
|
||||
echo '<details>' >> comment.txt
|
||||
echo '<summary>Changes were detected when running on open source projects</summary>' >> comment.txt
|
||||
echo '' >> comment.txt
|
||||
echo '```diff' >> comment.txt
|
||||
cat pr/mypy_primer_diff/mypy_primer.diff >> comment.txt
|
||||
echo '```' >> comment.txt
|
||||
echo '</details>' >> comment.txt
|
||||
else
|
||||
echo 'No ecosystem changes detected ✅' >> comment.txt
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue