Skip to content

Commit 0f3239a

Browse files
committed
Further abbreviate the "wrong language specifier" message; remove extra "please".
1 parent d4002eb commit 0f3239a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

bot/exts/info/codeblock/_instructions.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ def _get_bad_ticks_message(code_block: _parsing.CodeBlock) -> str | None:
5252
log.trace("Language specifier issue found; appending additional instructions.")
5353

5454
# The first line has double newlines which are not desirable when appending the msg.
55-
addition_msg = addition_msg.replace("\n\n", " ", 1)
55+
addition_msg = addition_msg.replace("\n\n", " ", 1).strip()
5656

5757
# Make the first character of the addition lower case.
58-
instructions += "\n\nFurthermore, " + addition_msg[0].lower() + addition_msg[1:]
58+
instructions += "\n\nAlso, " + addition_msg[0].lower() + addition_msg[1:]
5959
else:
6060
log.trace("No issues with the language specifier found.")
6161

@@ -106,10 +106,8 @@ def _get_bad_lang_message(content: str) -> str | None:
106106
example_blocks = _get_example(language)
107107

108108
# Note that _get_bad_ticks_message expects the first line to have two newlines.
109-
return (
110-
f"It looks like you incorrectly specified a language for your code block.\n\n{lines}"
111-
f"\n\n**Here is an example of how it should look:**\n{example_blocks}"
112-
)
109+
return f"\n\n{lines}\n\n**Here is an example of how it should look:**\n{example_blocks}"
110+
113111
log.trace("Nothing wrong with the language specifier; no instructions to return.")
114112
return None
115113

@@ -126,7 +124,7 @@ def _get_no_lang_message(content: str) -> str | None:
126124
example_blocks = _get_example("py")
127125

128126
# Note that _get_bad_ticks_message expects the first line to have two newlines.
129-
return f"Please add a `py` after the three backticks.\n\n{example_blocks}"
127+
return f"\n\nAdd a `py` after the three backticks.\n\n{example_blocks}"
130128

131129
log.trace("Aborting missing language instructions: content is not Python code.")
132130
return None

0 commit comments

Comments
 (0)