Use {cli} for formatting condition messages#2418
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2418 +/- ##
==========================================
- Coverage 98.15% 97.96% -0.19%
==========================================
Files 125 126 +1
Lines 5738 5743 +5
==========================================
- Hits 5632 5626 -6
- Misses 106 117 +11 ☔ View full report in Codecov by Sentry. |
My experience is this sets us up for a ton of toil maintaining brittle tests. Using
|
|
Directional greenlight that using {cli} signals is a go for me. @AshesITR, you? PS we should also add |
|
I agree with both of your comments. |
|
Btw, instead of just converting the old error messages to use On main branchlibrary(lintr)
backport_linter("oldrel-99")
#> Error: `r_version` must be a version number or one of 'devel', 'release', 'oldrel-1', 'oldrel-2', 'oldrel-3', 'oldrel-4', 'oldrel-5', 'oldrel-6', 'oldrel-7', 'oldrel-8', 'oldrel-9'Created on 2023-12-14 with reprex v2.0.2 On feature branchlibrary(lintr)
backport_linter("oldrel-99")
#> Error in `normalize_r_version()` at lintr/R/backport_linter.R:37:3:
#> ! `r_version` is not valid:
#> ℹ It must be a version number or one of 'devel', 'release', 'oldrel-1',
#> 'oldrel-2', 'oldrel-3', 'oldrel-4', 'oldrel-5', 'oldrel-6', 'oldrel-7',
#> 'oldrel-8', 'oldrel-9'
#> ✖ You entered 'oldrel-99' instead
#> Backtrace:
#> ▆
#> 1. └─lintr::backport_linter("oldrel-99")
#> 2. └─lintr:::normalize_r_version(r_version) at lintr/R/backport_linter.R:37:3
#> 3. └─cli::cli_abort(...) at lintr/R/backport_linter.R:96:7
#> 4. └─rlang::abort(...)Created on 2023-12-14 with reprex v2.0.2 |
Co-authored-by: Michael Chirico <michaelchirico4@gmail.com>
|
I am going to wait for all three reviewers to approve this before I merge it. |
|
Done the R/ code, it looks great! I will get to the tests/ changes in the next pass. Getting close! |
Closes #2386