Skip to content

Commit 6fa943f

Browse files
authored
Merge pull request #53 from JARVIS-discordbot/merge-fix-V3-develop
fix for conflicts
2 parents 6f1b6bb + f434fb6 commit 6fa943f

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

.github/workflows/check_label_pattern_exhaustiveness.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
run: |
2121
python -m pip install -U pip
2222
python -m pip install -U pathspec pyyaml rich typing_extensions
23-
2423
- name: Check label pattern exhaustiveness
2524
run: |
2625
python .github/workflows/scripts/check_label_pattern_exhaustiveness.py

redbot/cogs/alias/alias_entry.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ def get_extra_args_from_alias(self, message: discord.Message, prefix: str) -> st
5959
extra = []
6060
while not view.eof:
6161
prev = view.index
62-
word = view.get_quoted_word()
62+
try:
63+
word = view.get_quoted_word()
64+
except discord.ext.commands.errors.UnexpectedQuoteError:
65+
view.skip_ws()
66+
continue
6367
if len(word) < view.index - prev:
6468
word = "".join((view.buffer[prev], word, view.buffer[view.index - 1]))
6569
extra.append(word.strip(" "))

redbot/core/_cli.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,19 @@ def parse_cli_flags(args):
314314
default=None,
315315
help="Forcefully disables the Rich logging handlers.",
316316
)
317+
# DEP-WARN: use argparse.BooleanOptionalAction when we drop support for Python 3.8
318+
parser.add_argument(
319+
"--rich-tracebacks",
320+
action="store_true",
321+
default=False,
322+
help="Format the Python exception tracebacks using Rich (with syntax highlighting)."
323+
" *May* be useful to increase traceback readability during development.",
324+
)
325+
parser.add_argument(
326+
"--no-rich-tracebacks",
327+
action="store_false",
328+
dest="rich_tracebacks",
329+
)
317330
parser.add_argument(
318331
"--rich-traceback-extra-lines",
319332
type=non_negative_int,

redbot/logging.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import argparse
2+
import logging
23
import logging.handlers
34
import pathlib
45
import re
@@ -33,6 +34,7 @@
3334

3435

3536
MAX_OLD_LOGS = 8
37+
log = logging.getLogger("red.logging")
3638

3739

3840
class RotatingFileHandler(logging.handlers.RotatingFileHandler):
@@ -322,7 +324,7 @@ def init_logging(level: int, location: pathlib.Path, cli_flags: argparse.Namespa
322324
rich_formatter = logging.Formatter("{message}", datefmt="[%X]", style="{")
323325

324326
stdout_handler = RedRichHandler(
325-
rich_tracebacks=True,
327+
rich_tracebacks=cli_flags.rich_tracebacks,
326328
show_path=False,
327329
highlighter=NullHighlighter(),
328330
tracebacks_extra_lines=cli_flags.rich_traceback_extra_lines,
@@ -379,3 +381,9 @@ def init_logging(level: int, location: pathlib.Path, cli_flags: argparse.Namespa
379381
for fhandler in (latest_fhandler, all_fhandler):
380382
fhandler.setFormatter(file_formatter)
381383
root_logger.addHandler(fhandler)
384+
385+
if not enable_rich_logging and cli_flags.rich_tracebacks:
386+
log.warning(
387+
"Rich tracebacks were requested but they will not be enabled"
388+
" as Rich logging is not active."
389+
)

0 commit comments

Comments
 (0)