Skip to content

Error message format and colors #2132

Open
@rebcabin

Description

@rebcabin

I missed the all-important help line in the following

error message:

There are two "art direction" reasons for this:

  1. the color of the important line is a soft, purple, ignore-me. I suggest making it RED or YELLOW-ON-BLACK or something else more eye-catching (just NOT blue-on-black, or yellow-on-white, the two NEVER color combinations)
  2. Other error messages do not have anything in that position, so I got accustomed to never looking there. Suggest ALWAYS putting a help line, even if it's empty! Here is an example of the error messages I see all the time:
(lp) ┌─(~/CLionProjects/lpython/lasr/LP-pycharm)─────────────────────────────────────────────────────────────────────────────────────────────────────────(brian@Golf37:s012)─┐
└─(11:39:11 on brian-lasr ✹ ✭)──> ~/CLionProjects/lpython/src/bin/lpython -I. issue2126.py                                                            1 ↵ ──(Sun,Jul09)─┘
semantic error: Type mismatch in comparison operator, the types must be compatible
  --> issue2126.py:18:12
   |
18 |     assert foo.dim == x.dim == y.dim == z.dim
   |            ^^^^^^^^^^^^^^^^    ^^^^^ type mismatch ('bool' and 'i32')


Note: if any of the above error or warning messages are not clear or are lacking
context please report it to us (we consider that a bug that must be fixed).

and a suggestion for improvement:

(lp) ┌─(~/CLionProjects/lpython/lasr/LP-pycharm)─────────────────────────────────────────────────────────────────────────────────────────────────────────(brian@Golf37:s012)─┐
└─(11:39:11 on brian-lasr ✹ ✭)──> ~/CLionProjects/lpython/src/bin/lpython -I. issue2126.py                                                            1 ↵ ──(Sun,Jul09)─┘
semantic error: Type mismatch in comparison operator, the types must be compatible
  --> issue2126.py:18:12
   |
18 |     assert foo.dim == x.dim == y.dim == z.dim
   |            ^^^^^^^^^^^^^^^^    ^^^^^ type mismatch ('bool' and 'i32')

  --> help: separate the boolean tests into binary forms.

Note: if any of the above error or warning messages are not clear or are lacking
context please report it to us (we consider that a bug that must be fixed).

in this way, the --> help line has equal visual status to the --> issue ... line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions