Skip to content

Commit ac4fe74

Browse files
committed
ci: don't truncate primer comment
1 parent d328c22 commit ac4fe74

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

.github/workflows/mypy_primer_comment.yml

-20
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,9 @@ jobs:
4848
with:
4949
github-token: ${{ secrets.GITHUB_TOKEN }}
5050
script: |
51-
const MAX_CHARACTERS = 30000
52-
const MAX_CHARACTERS_PER_PROJECT = MAX_CHARACTERS / 3
53-
5451
const fs = require('fs')
5552
let data = fs.readFileSync('fulldiff.txt', { encoding: 'utf8' })
5653
57-
function truncateIfNeeded(original, maxLength) {
58-
if (original.length <= maxLength) {
59-
return original
60-
}
61-
let truncated = original.substring(0, maxLength)
62-
// further, remove last line that might be truncated
63-
truncated = truncated.substring(0, truncated.lastIndexOf('\n'))
64-
let lines_truncated = original.split('\n').length - truncated.split('\n').length
65-
return `${truncated}\n\n... (truncated ${lines_truncated} lines) ...`
66-
}
67-
68-
const projects = data.split('\n\n')
69-
// don't let one project dominate
70-
data = projects.map(project => truncateIfNeeded(project, MAX_CHARACTERS_PER_PROJECT)).join('\n\n')
71-
// posting comment fails if too long, so truncate
72-
data = truncateIfNeeded(data, MAX_CHARACTERS)
73-
7454
console.log("Diff from mypy_primer:")
7555
console.log(data)
7656

0 commit comments

Comments
 (0)