Skip to content

Commit 0628e09

Browse files
authored
mypy_primer: report lines truncated (#12910)
Co-authored-by: hauntsaninja <>
1 parent 2004ae0 commit 0628e09

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/mypy_primer_comment.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ jobs:
5151
let data = fs.readFileSync('fulldiff.txt', { encoding: 'utf8' })
5252
// posting comment fails if too long, so truncate
5353
if (data.length > 30000) {
54-
data = data.substring(0, 30000) + `\n\n... (truncated ${data.length - 30000} chars) ...\n`
54+
let truncated_data = data.substring(0, 30000)
55+
let lines_truncated = data.split('\n').length - truncated_data.split('\n').length
56+
data = truncated_data + `\n\n... (truncated ${lines_truncated} lines) ...\n`
5557
}
5658
5759
console.log("Diff from mypy_primer:")

0 commit comments

Comments
 (0)