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

Refer to canonical pacakge in case of duplicates #97

Merged
merged 8 commits into from
Oct 6, 2023
Merged

Conversation

krlmlr
Copy link
Member

@krlmlr krlmlr commented Sep 26, 2023

This also deals with the case where two packages import from a third package, and a fourth package overwrites it.

Will add tests.

Closes #93.

Example

library(conflicted)
library(plyr)
library(dm)
library(mcmcdata)

mutate
#> Error:
#> ! [conflicted] mutate found in 2 packages.
#> Either pick the one you want with `::`:
#> • dplyr::mutate
#> • plyr::mutate
#> Or declare a preference with `conflicts_prefer()`:
#> • `conflicts_prefer(dplyr::mutate)`
#> • `conflicts_prefer(plyr::mutate)`
#> Backtrace:
#>     ▆
#>  1. └─conflicted (local) `<fn>`()
#>  2.   └─cli::cli_abort(...) at conflicted/R/disambiguate.R:51:4
#>  3.     └─rlang::abort(...)

Created on 2023-09-26 with reprex v2.0.2

@krlmlr krlmlr requested a review from hadley September 26, 2023 13:15
@krlmlr
Copy link
Member Author

krlmlr commented Sep 26, 2023

Seeing weird behavior, will update:

conflicted::conflict_scout(c("devtools", "remotes"))
#> Error: bad namespace name

Created on 2023-09-26 with reprex v2.0.2

R/utils.R Outdated Show resolved Hide resolved
R/utils.R Outdated Show resolved Hide resolved
tests/testthat/_snaps/find.md Outdated Show resolved Hide resolved
@krlmlr
Copy link
Member Author

krlmlr commented Sep 27, 2023

Thanks for the guidance, it was very helpful!

@krlmlr krlmlr requested a review from hadley September 27, 2023 21:18
@krlmlr krlmlr merged commit 9fabdc7 into main Oct 6, 2023
12 checks passed
@krlmlr krlmlr deleted the b-93-canonical branch October 6, 2023 13:43
@krlmlr krlmlr restored the b-93-canonical branch October 6, 2023 13:43
@hadley hadley deleted the b-93-canonical branch October 30, 2023 20:37
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.

Resolution of conflicts between a function and a method that's being reexported
2 participants