From 0c84a56700a26fa766f58052497c3731328139db Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Mon, 11 Jan 2021 18:36:49 -0800 Subject: [PATCH] command/format: Use box drawing chars for rules in diagnostics We were previously using some ASCII art to create some visual divisions between parts of the diagnostic output. Now that we are requiring a UTF-8 terminal we can print out box drawing characters instead. --- command/format/diagnostic.go | 4 ++-- command/format/diagnostic_test.go | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/command/format/diagnostic.go b/command/format/diagnostic.go index 895876df3..a7e41d923 100644 --- a/command/format/diagnostic.go +++ b/command/format/diagnostic.go @@ -172,10 +172,10 @@ func Diagnostic(diag tfdiags.Diagnostic, sources map[string][]byte, color *color sort.Strings(stmts) // FIXME: Should maybe use a traversal-aware sort that can sort numeric indexes properly? if len(stmts) > 0 { - fmt.Fprint(&buf, color.Color(" [dark_gray]|----------------[reset]\n")) + fmt.Fprint(&buf, color.Color(" [dark_gray]├────────────────[reset]\n")) } for _, stmt := range stmts { - fmt.Fprintf(&buf, color.Color(" [dark_gray]|[reset] %s\n"), stmt) + fmt.Fprintf(&buf, color.Color(" [dark_gray]│[reset] %s\n"), stmt) } } diff --git a/command/format/diagnostic_test.go b/command/format/diagnostic_test.go index 3895dba6a..ee333eaca 100644 --- a/command/format/diagnostic_test.go +++ b/command/format/diagnostic_test.go @@ -94,8 +94,8 @@ Whatever shall we do? on test.tf line 1: 1: test [underline]source[reset] code - [dark_gray]|----------------[reset] - [dark_gray]|[reset] [bold]boop.beep[reset] is "blah" + [dark_gray]├────────────────[reset] + [dark_gray]│[reset] [bold]boop.beep[reset] is "blah" Whatever shall we do? `, @@ -127,8 +127,8 @@ Whatever shall we do? on test.tf line 1: 1: test [underline]source[reset] code - [dark_gray]|----------------[reset] - [dark_gray]|[reset] [bold]boop.beep[reset] has a sensitive value + [dark_gray]├────────────────[reset] + [dark_gray]│[reset] [bold]boop.beep[reset] has a sensitive value Whatever shall we do? `, @@ -160,8 +160,8 @@ Whatever shall we do? on test.tf line 1: 1: test [underline]source[reset] code - [dark_gray]|----------------[reset] - [dark_gray]|[reset] [bold]boop.beep[reset] is a string, known only after apply + [dark_gray]├────────────────[reset] + [dark_gray]│[reset] [bold]boop.beep[reset] is a string, known only after apply Whatever shall we do? `, @@ -193,8 +193,8 @@ Whatever shall we do? on test.tf line 1: 1: test [underline]source[reset] code - [dark_gray]|----------------[reset] - [dark_gray]|[reset] [bold]boop.beep[reset] will be known only after apply + [dark_gray]├────────────────[reset] + [dark_gray]│[reset] [bold]boop.beep[reset] will be known only after apply Whatever shall we do? `,