You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
-
70
+
if (data.length >= MAX_CHARACTERS) {
71
+
const projects = data.split('\n\n')
72
+
// don't let one project dominate
73
+
data = projects.map(project => truncateIfNeeded(project, MAX_CHARACTERS_PER_PROJECT)).join('\n\n')
74
+
}
74
75
console.log("Diff from mypy_primer:")
75
76
console.log(data)
76
77
77
78
let body
78
79
if (data.trim()) {
79
-
body = 'Diff from [mypy_primer](https://github.com/hauntsaninja/mypy_primer), showing the effect of this PR on open source code:\n```diff\n' + data + '```'
80
+
data = '```diff\n' + data
81
+
if (data.split('\n').length > 500) {
82
+
data = '<details><summary></summary>\n\n' + data + '```'
83
+
}
84
+
body = 'Diff from [mypy_primer](https://github.com/hauntsaninja/mypy_primer), showing the effect of this PR on open source code:\n' + data
body = 'According to [mypy_primer](https://github.com/hauntsaninja/mypy_primer), this change has no effect on the checked open source code. 🤖🎉'
0 commit comments