mypy_primer: report lines truncated (#7993)

Co-authored-by: hauntsaninja <>
This commit is contained in:
Shantanu
2022-05-30 17:04:34 -07:00
committed by GitHub
parent a7ff433fc3
commit bf68214245

View File

@@ -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