mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-10 21:42:25 +08:00
Increase mypy_primer comment length (#9598)
This commit is contained in:
8
.github/workflows/mypy_primer_comment.yml
vendored
8
.github/workflows/mypy_primer_comment.yml
vendored
@@ -50,9 +50,11 @@ jobs:
|
||||
script: |
|
||||
const fs = require('fs')
|
||||
let data = fs.readFileSync('fulldiff.txt', { encoding: 'utf8' })
|
||||
// posting comment fails if too long, so truncate
|
||||
if (data.length > 30000) {
|
||||
let truncated_data = data.substring(0, 30000)
|
||||
|
||||
// Maximum comment length is 65536 characters. We need much less than 236 for extra text.
|
||||
const MAX_LENGTH = 65300
|
||||
if (data.length > MAX_LENGTH) {
|
||||
let truncated_data = data.substring(0, MAX_LENGTH)
|
||||
let lines_truncated = data.split('\n').length - truncated_data.split('\n').length
|
||||
data = truncated_data + `\n\n... (truncated ${lines_truncated} lines) ...\n`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user