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

Switch to cli and use clickable links #74

Merged
merged 8 commits into from Jan 10, 2023
Merged

Switch to cli and use clickable links #74

merged 8 commits into from Jan 10, 2023

Conversation

hadley
Copy link
Member

@hadley hadley commented Oct 7, 2022

No description provided.

R/disambiguate.R Outdated Show resolved Hide resolved
R/disambiguate.R Outdated Show resolved Hide resolved
R/disambiguate.R Outdated Show resolved Hide resolved
DESCRIPTION Outdated Show resolved Hide resolved
prefer_bullets <- function(pkgs, name) {
prefer <- map_chr(pkgs, function(pkg) {
cli::format_inline("{.run [conflict_prefer(\"{name}\", \"{pkg}\")](conflicted::conflict_prefer(\"{name}\", \"{pkg}\"))}")
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation seems off here. More importantly, no need to call format_inline() here, because later we pass this to cli_abort() which does the formatting (again). So it could be something like

sprintf("{.run [conflict_prefer(\"%s\", \"%s\")](conflicted::conflict_prefer(\"%s\", \"%s\"))}", name, pkg, name, pkg)

R/find.R Outdated Show resolved Hide resolved
hadley and others added 2 commits January 9, 2023 17:46
Co-authored-by: Gábor Csárdi <csardi.gabor@gmail.com>
@@ -26,7 +26,7 @@ disambiguate_infix <- function(name, pkgs) {

cli::cli_abort(c(
"{label_conflicted()} {.strong {name}} found in {length(pkgs)} packages.",
"Declare a preference with `conflict_prefer()`:",
"Declare a preference with {.code conflict_prefer()}:",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to link to the help here? Or use {.fn conflict_prefer}?

namespace,
"Or declare a preference with `conflict_prefer()`:",
"Or declare a preference with {.code conflict_prefer}:",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Or declare a preference with {.code conflict_prefer}:",
"Or declare a preference with {.fn conflict_prefer}:",

@gaborcsardi
Copy link
Member

Looks good!

@hadley hadley merged commit 76a1bb0 into main Jan 10, 2023
@hadley hadley deleted the cli branch January 10, 2023 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants