dantleech / what-changed

Generate change reports when you update composer
MIT License
118 stars 2 forks source link

Truncate too early on 80 character width terminal #15

Open simonschaufi opened 4 years ago

simonschaufi commented 4 years ago

I have a 80 character terminal in ubuntu and the commit message is truncated way too early. For comparison I added a line below to see how much space there is still available.

dantleech/what-changed: 9 updated

  laravel/framework 8299b6dc..4de12917

    [2020-03-26 16:43:40] 3c692967 ThomasTrost ...

> |----------------------------------------------------------------------------|
dantleech commented 4 years ago

hmm, I guess this is the culprit: https://github.com/dantleech/what-changed/blob/master/lib/Adapter/Symfony/Report/ConsoleReport.php

not sure why I truncate at <Terminal Width> - 30

simonschaufi commented 4 years ago

Looking at the class, I found a lot more bugs as lots of tags (info, comment) are not closed properly

dantleech commented 4 years ago

</>? that's valid if that's what you mean?

simonschaufi commented 4 years ago

I haven't seen this kind of closing tag in symfony console yet.

In lots of cases I see a line like this in the output: [2020-04-03 05:57:47] 6f19efdc sebastianbergmann</com... and as you can see, the closing tag is also truncated. That's what I mean.

dantleech commented 4 years ago

yes -- that's because we truncate the string with the formatting tags - maybe there is a good solution for this in Symfony, not sure.

simonschaufi commented 4 years ago

Maybe ignore the counting of additional characters while you are in a tag and then only count the characters outside. The main point of this issue is the total length. What i mentioned now is actually another bug.