lifecycle icon indicating copy to clipboard operation
lifecycle copied to clipboard

lintr >= 3.0.0 support

Open AshesITR opened this issue 2 years ago • 3 comments

Still missing some documentation.

NB there are quite a few lints on lifecycle code:

Lints in lifecycle code
R/compat-obj-type.R:58:9: style: [lifecycle_linter] `rlang::is_na` is questioning
    if (is_na(x)) {
        ^~~~~
R/deprecate.R:288:16: style: [lifecycle_linter] `rlang::chr` is questioning
    details 

AshesITR avatar Nov 19 '23 14:11 AshesITR

fixes #122, #155, #165, #178, #179

AshesITR avatar Nov 19 '23 14:11 AshesITR

I'm not sure if pkg_lifecycle_statuses() is documented in a good place at ?lifecycle_linter. Also, pattern= might drift from lintr in the future. It might be worth deprecating the argument and not passing it on?

Users of lintr could simply add linters: linters_with_defaults(lifecycle::lifecycle_linter()) to their configs to include it in the regular workflow.

I also opted to default to tidyverse::tidyverse_packages() for the packages= argument of lifecycle_linter(). This makes lifecycle::lifecycle_linter() behave nicely by default, but implicitly requires tidyverse or a non-missing packages= argument. I could add a check for robustness there if you agree with this behavior.

AshesITR avatar Nov 19 '23 14:11 AshesITR

cc @hadley LMK if you need anything. I didn't write any tests because there were none before and adding them would require a significant amount of work.

AshesITR avatar Nov 28 '23 18:11 AshesITR