Sceptre/sceptre

Colouring disabled in dump commands

alex-harvey-z3q opened this issue · 1 comments

Subject of the issue

Colouring always disabled in dump commands.

Your environment

  • version of sceptre (sceptre --version) master branch
  • version of python (python --version) 3.10
  • which OS/distro Ubuntu

Steps to reproduce

Run dump config etc.

Expected behaviour

Colouring should be enabled by default.

Actual behaviour

Colouring is always disabled.

Actually not a bug. I was about to submit this patch:

diff --git a/sceptre/cli/dump.py b/sceptre/cli/dump.py
index e267094..b946d73 100644
--- a/sceptre/cli/dump.py
+++ b/sceptre/cli/dump.py
@@ -58,7 +58,7 @@ def dump_config(ctx, to_file, path):
             logger.info(f"{stack_name} dump to {file_path} complete.")
 
         else:
-            write(config, output_format, no_colour=True)
+            write(config, output_format)
 
 
 @dump_group.command(name="template")
@@ -111,7 +111,7 @@ def dump_template(ctx, to_file, no_placeholders, path):
             logger.info(f"{stack_name} dump to {file_path} complete.")
 
         else:
-            write(template, output_format, no_colour=True)
+            write(template, output_format)
 
 
 @dump_group.command(name="all")

However I then realised that no colouring is defaulting to True anyway

def write(
    var: Any,
    output_format: str = "json",
    no_colour: bool = True,
    file_path: Optional[Path] = None,
) -> None:

While there appears to be no point specifying no_colour in the dump calls, it's probably not really worth changing.