mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 06:41:23 +00:00
[red-knot] mypy_primer: strip ANSI codes (#16604)
## Summary Strip ANSI codes in the mypy_primer diff before uploading. ## Test Plan Successful run here: https://github.com/astral-sh/ruff/pull/16601
This commit is contained in:
parent
a73548d0ca
commit
ec9ee93d68
2 changed files with 9 additions and 4 deletions
3
.github/workflows/mypy_primer.yaml
vendored
3
.github/workflows/mypy_primer.yaml
vendored
|
@ -10,6 +10,7 @@ on:
|
|||
- "crates/ruff_python_ast"
|
||||
- "crates/ruff_python_parser"
|
||||
- ".github/workflows/mypy_primer.yaml"
|
||||
- ".github/workflows/mypy_primer_comment.yaml"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
|
||||
|
@ -67,7 +68,7 @@ jobs:
|
|||
--new "$GITHUB_SHA" \
|
||||
--project-selector '/(mypy_primer|black|pyp|git-revise|zipp|arrow)$' \
|
||||
--output concise \
|
||||
--debug | tee mypy_primer.diff
|
||||
--debug | tee /dev/stdout | sed -e 's/\x1b\[[0-9;]*m//g' > mypy_primer.diff
|
||||
) || [ $? -eq 1 ]
|
||||
|
||||
echo ${{ github.event.number }} > pr-number
|
||||
|
|
10
.github/workflows/mypy_primer_comment.yaml
vendored
10
.github/workflows/mypy_primer_comment.yaml
vendored
|
@ -62,9 +62,13 @@ jobs:
|
|||
echo '<!-- generated-comment mypy_primer -->' >> comment.txt
|
||||
|
||||
echo '## `mypy_primer` results' >> comment.txt
|
||||
echo '```diff' >> comment.txt
|
||||
cat pr/mypy_primer_diff/mypy_primer.diff >> comment.txt
|
||||
echo '```' >> comment.txt
|
||||
if [ -s "pr/mypy_primer_diff/mypy_primer.diff" ]; then
|
||||
echo '```diff' >> comment.txt
|
||||
cat pr/mypy_primer_diff/mypy_primer.diff >> comment.txt
|
||||
echo '```' >> comment.txt
|
||||
else
|
||||
echo 'No ecosystem changes detected ✅' >> comment.txt
|
||||
fi
|
||||
|
||||
echo 'comment<<EOF' >> "$GITHUB_OUTPUT"
|
||||
cat comment.txt >> "$GITHUB_OUTPUT"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue