Skip to content

add --message-format short option #4165

Closed
@vitiral

Description

@vitiral

--message-format currently has the following options:

--message-format FMT         Error format: human, json [default: human]

I would like an additional option to be added: short. Other possible names:

  • brief
  • oneline

I've been programming in rust for the better part of a year now. The compiler has been my friend and mentor through this time, and a big part of that has been the fantastic human readable error messages. Thank you so much for them!

However, I have gotten much more familiar with the language and my common mistakes, so (often) no longer need error messages to be so long (sometimes they are longer than 10-15 lines!). Normally I just need the compiler to give the me the file, line/col number and name of te error and I can spot it myself very quickly.

For an experienced programmer, a shorter format would make finding errors much more ergonomic.

The following pipe does roughly what I want, although it would be nice if it was all on one line:

# cargo test |& rg "(error\[\w+\])|(^\s+--> \w+/\w+)" -N --color never
error[E0061]: this function takes 2 parameters but 3 parameters were supplied
   --> src/user/tests.rs:186:37
error[E0061]: this function takes 2 parameters but 3 parameters were supplied
   --> src/export.rs:133:51
error[E0061]: this function takes 2 parameters but 3 parameters were supplied
   --> src/export.rs:139:37
error[E0063]: missing field `revision` in initializer of `export::ArtifactData`
   --> src/export.rs:149:20

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions