@@ -184,44 +184,37 @@ def _create_comment(
184
184
185
185
# Create comment for new messages
186
186
count = 1
187
- fatal_count = 1
188
- new_non_fatal_messages = ""
189
- new_fatal_messages = ""
187
+ astroid_errors = 0
188
+ new_non_astroid_messages = ""
190
189
if new_messages :
191
190
print ("Now emitted:" )
192
191
for message in new_messages :
193
- if message ["type" ] == "fatal" :
194
- filepath = str (message ["path" ]).replace (
195
- str (package_data .clone_directory ), ""
196
- )
197
- new_fatal_messages += (
198
- f"{ fatal_count } ) { message ['symbol' ]} :\n *{ message ['message' ]} *\n "
199
- "**Please check your changes on the following file**:\n "
200
- f"{ package_data .url } /blob/{ package_data .branch } { filepath } #L{ message ['line' ]} \n "
201
- )
202
- print (message )
203
- fatal_count += 1
192
+ filepath = str (message ["path" ]).replace (
193
+ str (package_data .clone_directory ), ""
194
+ )
195
+ # Existing astroid errors may still show up as "new" because the timestamp
196
+ # in the message is slightly different.
197
+ if message ["symbol" ] == "astroid-error" :
198
+ astroid_errors += 1
204
199
else :
205
- filepath = str (message ["path" ]).replace (
206
- str (package_data .clone_directory ), ""
207
- )
208
- new_non_fatal_messages += (
200
+ new_non_astroid_messages += (
209
201
f"{ count } ) { message ['symbol' ]} :\n *{ message ['message' ]} *\n "
210
202
f"{ package_data .url } /blob/{ package_data .branch } { filepath } #L{ message ['line' ]} \n "
211
203
)
212
204
print (message )
213
205
count += 1
214
206
215
- if new_fatal_messages :
207
+ if astroid_errors :
216
208
comment += (
217
- "The following **fatal messages** are now emitted: 💣💥\n \n <details>\n \n "
218
- + new_fatal_messages
219
- + "\n </details>\n \n "
209
+ f"{ astroid_errors } error(s) were found stemming from the `astroid` library. "
210
+ "This is unlikely to have been caused by your changes. "
211
+ "A GitHub Actions warning links directly to the crash report template. "
212
+ "Please open an issue against `astroid` if one does not exist already. \n \n "
220
213
)
221
- if new_non_fatal_messages :
214
+ if new_non_astroid_messages :
222
215
comment += (
223
216
"The following messages are now emitted:\n \n <details>\n \n "
224
- + new_non_fatal_messages
217
+ + new_non_astroid_messages
225
218
+ "\n </details>\n \n "
226
219
)
227
220
0 commit comments