mirror of https://github.com/astral-sh/ruff
[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
|
|
@ -61,16 +61,22 @@ jobs:
|
||||||
echo "Running mypy_primer"
|
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 \
|
--repo ruff \
|
||||||
--type-checker knot \
|
--type-checker knot \
|
||||||
--old base_commit \
|
--old base_commit \
|
||||||
--new "$GITHUB_SHA" \
|
--new "$GITHUB_SHA" \
|
||||||
--project-selector '/(mypy_primer|black|pyp|git-revise|zipp|arrow)$' \
|
--project-selector '/(mypy_primer|black|pyp|git-revise|zipp|arrow)$' \
|
||||||
--output concise \
|
--output concise \
|
||||||
--debug | tee /dev/stdout | sed -e 's/\x1b\[[0-9;]*m//g' > mypy_primer.diff
|
--debug > mypy_primer.diff
|
||||||
) || [ $? -eq 1 ]
|
) || [ $? -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
|
echo ${{ github.event.number }} > pr-number
|
||||||
|
|
||||||
- name: Upload diff
|
- name: Upload diff
|
||||||
|
|
|
||||||
|
|
@ -63,9 +63,13 @@ jobs:
|
||||||
|
|
||||||
echo '## `mypy_primer` results' >> comment.txt
|
echo '## `mypy_primer` results' >> comment.txt
|
||||||
if [ -s "pr/mypy_primer_diff/mypy_primer.diff" ]; then
|
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
|
echo '```diff' >> comment.txt
|
||||||
cat pr/mypy_primer_diff/mypy_primer.diff >> comment.txt
|
cat pr/mypy_primer_diff/mypy_primer.diff >> comment.txt
|
||||||
echo '```' >> comment.txt
|
echo '```' >> comment.txt
|
||||||
|
echo '</details>' >> comment.txt
|
||||||
else
|
else
|
||||||
echo 'No ecosystem changes detected ✅' >> comment.txt
|
echo 'No ecosystem changes detected ✅' >> comment.txt
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue