Commit 76c471f
committed
bump: print skip status, message(s), and errors
`brew livecheck` surfaces the skip reason or message in its output
(e.g., "deprecated", "skipped - Legacy version") but `brew bump`
effectively ignores the `:status` and `:messages` values from
`Livecheck::SkipConditions` and only prints "skipped" instead.
Sometimes the reason can be inferred from parenthetical annotations
(e.g., "(deprecated)" after the current version) but explicit output
like "skipped - deprecated" is easier to read when skimming. Omitting
a skip message from a `livecheck` block is only done to produce a
predictable "skipped" string that can be used for comparison but we
can handle that in a more robust way.
A related issue we're now facing is that deprecated packages are
producing an "unable to get versions" message rather than "skipped".
This adds noise and makes it more challenging to identify real
livecheck failures in bump output.
This addresses these issues by modifying bump to print the skip
`:status` and `:messages` values in the output. The way I've handled
this, bump will also print error messages. In the process, this adds
a `message?` method to check whether a value is a message string,
replacing existing conditions that insufficiently check whether a
value is a message using strict comparisons like `x != "skipped"` or
`x != "unable to get versions"` and ignoring the possibility of error
strings.
This is still an imperfect way of identifying message strings but it
should be an improvement over the status quo. In the future, it may be
better to store message strings as something other than a
`Cask::DSL::Version` object, so we can distinguish messages from
versions without targeting a specific string pattern.1 parent 2316400 commit 76c471f
2 files changed
Lines changed: 54 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
282 | | - | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
283 | 287 | | |
284 | 288 | | |
285 | 289 | | |
| |||
369 | 373 | | |
370 | 374 | | |
371 | 375 | | |
372 | | - | |
| 376 | + | |
| 377 | + | |
373 | 378 | | |
374 | | - | |
375 | | - | |
376 | 379 | | |
377 | 380 | | |
378 | 381 | | |
| |||
433 | 436 | | |
434 | 437 | | |
435 | 438 | | |
436 | | - | |
437 | | - | |
| 439 | + | |
438 | 440 | | |
439 | 441 | | |
440 | 442 | | |
441 | 443 | | |
442 | 444 | | |
443 | 445 | | |
444 | | - | |
445 | | - | |
| 446 | + | |
446 | 447 | | |
447 | 448 | | |
448 | 449 | | |
449 | | - | |
450 | | - | |
| 450 | + | |
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
| |||
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
634 | | - | |
635 | | - | |
| 634 | + | |
636 | 635 | | |
637 | 636 | | |
638 | 637 | | |
| |||
652 | 651 | | |
653 | 652 | | |
654 | 653 | | |
655 | | - | |
656 | | - | |
| 654 | + | |
657 | 655 | | |
658 | 656 | | |
659 | 657 | | |
| |||
678 | 676 | | |
679 | 677 | | |
680 | 678 | | |
681 | | - | |
682 | | - | |
| 679 | + | |
683 | 680 | | |
684 | 681 | | |
685 | 682 | | |
686 | 683 | | |
687 | 684 | | |
688 | | - | |
689 | | - | |
| 685 | + | |
690 | 686 | | |
691 | 687 | | |
692 | 688 | | |
| |||
745 | 741 | | |
746 | 742 | | |
747 | 743 | | |
748 | | - | |
749 | | - | |
| 744 | + | |
750 | 745 | | |
751 | 746 | | |
752 | 747 | | |
| |||
803 | 798 | | |
804 | 799 | | |
805 | 800 | | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
806 | 808 | | |
807 | 809 | | |
808 | 810 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
155 | 186 | | |
0 commit comments