From bf68214245c877c206d7e4b407f4c4de8d0dcb8a Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Mon, 30 May 2022 17:04:34 -0700 Subject: [PATCH] mypy_primer: report lines truncated (#7993) Co-authored-by: hauntsaninja <> --- .github/workflows/mypy_primer_comment.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mypy_primer_comment.yml b/.github/workflows/mypy_primer_comment.yml index 32dd2f177..6413cce7a 100644 --- a/.github/workflows/mypy_primer_comment.yml +++ b/.github/workflows/mypy_primer_comment.yml @@ -51,7 +51,9 @@ jobs: let data = fs.readFileSync('fulldiff.txt', { encoding: 'utf8' }) // posting comment fails if too long, so truncate if (data.length > 30000) { - data = data.substring(0, 30000) + `\n\n... (truncated ${data.length - 30000} chars) ...\n` + let truncated_data = data.substring(0, 30000) + let lines_truncated = data.split('\n').length - truncated_data.split('\n').length + data = truncated_data + `\n\n... (truncated ${lines_truncated} lines) ...\n` } let body