aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-06-27 16:09:54 -0700
committerGravatar MarkKoz <[email protected]>2020-06-27 16:09:54 -0700
commit94017fdf0e3c9805e3ead81823f3870d3834edd5 (patch)
treec0570434b1598ca8d2d3f2621ed3e59405072909
parentMerge remote-tracking branch 'origin/master' into bug/utility/829/non-py-code... (diff)
Code block: rename BadLanguage attributes
The `has_` prefix it clarifies that they're booleans. Co-authored-by: Numerlor <[email protected]>
-rw-r--r--bot/cogs/codeblock/instructions.py4
-rw-r--r--bot/cogs/codeblock/parsing.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/bot/cogs/codeblock/instructions.py b/bot/cogs/codeblock/instructions.py
index c9db80deb..4ea5ca094 100644
--- a/bot/cogs/codeblock/instructions.py
+++ b/bot/cogs/codeblock/instructions.py
@@ -100,11 +100,11 @@ def _get_bad_lang_message(content: str) -> Optional[str]:
lines = []
language = info.language
- if info.leading_spaces:
+ if info.has_leading_spaces:
log.trace("Language specifier was preceded by a space.")
lines.append(f"Make sure there are no spaces between the back ticks and `{language}`.")
- if not info.terminal_newline:
+ if not info.has_terminal_newline:
log.trace("Language specifier was not followed by a newline.")
lines.append(
f"Make sure you put your code on a new line following `{language}`. "
diff --git a/bot/cogs/codeblock/parsing.py b/bot/cogs/codeblock/parsing.py
index 89f8111fc..73b6a874e 100644
--- a/bot/cogs/codeblock/parsing.py
+++ b/bot/cogs/codeblock/parsing.py
@@ -60,8 +60,8 @@ class BadLanguage(NamedTuple):
"""Parsed information about a poorly formatted language specifier."""
language: str
- leading_spaces: bool
- terminal_newline: bool
+ has_leading_spaces: bool
+ has_terminal_newline: bool
def find_code_blocks(message: str) -> Optional[Sequence[CodeBlock]]: