Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support cli functions in extract_glued_symbols() #2252

Open
Bisaloo opened this issue Oct 31, 2023 · 0 comments
Open

Support cli functions in extract_glued_symbols() #2252

Bisaloo opened this issue Oct 31, 2023 · 0 comments
Labels
feature a feature request or enhancement

Comments

@Bisaloo
Copy link
Contributor

Bisaloo commented Oct 31, 2023

# glue::glue passes
lintr::lint(
  text = "foo <- function() { x <- 1; glue::glue('{x}') }",
  linters = lintr::object_usage_linter()
)

# cli functions lint
lintr::lint(
  text = "foo <- function() { x <- 1; cli::cli_h1('{x}') }",
  linters = lintr::object_usage_linter()
)
#> <text>:1:21: warning: [object_usage_linter] local variable 'x' assigned but may not be used
#> foo <- function() { x <- 1; cli::cli_h1('{x}') }
#>                     ^

# This is valid cli usage
x <- 1
cli::cli_h1('{x}')
#> 
#> ── 1 ───────────────────────────────────────────────────────────────────────────

Created on 2023-10-31 with reprex v2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants