Duhemm / sbt-errors-summary

sbt plugin to show a summary of compilation messages.
MIT License
201 stars 11 forks source link

Bring clarity when colour aren't available #12

Closed dwijnand closed 7 years ago

dwijnand commented 7 years ago

I'm concerned by the UX when colour aren't available. What does this mean?

[error] /src/main/scala/Bar.scala: 2 [1], 4 [2]
[error] /src/main/scala/Foo.scala: 2 [3]

Brainstorming, I wonder if it would be more intuitive if it were:

[error] /src/main/scala/Bar.scala: [1] (2 times), [2] (4 times)
[error] /src/main/scala/Foo.scala: [3] (2 times)

Another alternative, perhaps, is to use letters rather than numbers to label the errors. So it might be [A] (2 times)

I was also playing around.. what about [1] (2x) as short hand for "2 times"..

I don't have any clear winners, but I thought I should open an issue to start a conversation.

Duhemm commented 7 years ago

The number between square brackets represent the ID of the error, not how many times the error occurred. The number before it is the offending line. I'm definitely not against identifying the errors using a letter instead:

[error] /src/main/scala/Bar.scala: 2 [A], 4 [B]
[error] /src/main/scala/Foo.scala: 2 [C]
dwijnand commented 7 years ago

The number before it is the offending line.

Oh wow. That wasn't obvious even with the colour.. :-/

japgolly commented 7 years ago

I had the exact same initial response and confusion :grinning:

I'm not sure how to keep this both concise and comprehensive without context... Maybe something like:

[error] /src/main/scala/Bar.scala: (3 errors) Problems [2-4] at lines [15,16,37]
dwijnand commented 7 years ago

Another alternative to letters is prepending with a hash, so it kind of looks like an issue number: #1.

yawaramin commented 7 years ago

One reasonably common way to identify line numbers is with an 'L' prefix. We can extend that by prefixing errors with 'E'.

[error] /src/main/scala/Bar.scala: L2 [E1], L4 [E2]

A 'legend' at the start (or end) of the error report would be nice though:

Ln: line number n
En: error number n