diff --git a/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md similarity index 85% rename from CODE_OF_CONDUCT.md rename to .github/CODE_OF_CONDUCT.md index 8d7cf5a..3ac34c8 100644 --- a/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -6,8 +6,8 @@ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity and -orientation. +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. @@ -21,25 +21,25 @@ community include: * Being respectful of differing opinions, viewpoints, and experiences * Giving and gracefully accepting constructive feedback * Accepting responsibility and apologizing to those affected by our mistakes, -and learning from the experience + and learning from the experience * Focusing on what is best not just for us as individuals, but for the overall -community + community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or -advances of any kind +* The use of sexualized language or imagery, and sexual attention or advances of + any kind * Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment -* Publishing others' private information, such as a physical or email -address, without their explicit permission +* Publishing others' private information, such as a physical or email address, + without their explicit permission * Other conduct which could reasonably be considered inappropriate in a -professional setting + professional setting ## Enforcement Responsibilities -Community leaders are responsible for clarifying and enforcing our standards -of acceptable behavior and will take appropriate and fair corrective action in +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. @@ -50,16 +50,16 @@ decisions when appropriate. ## Scope -This Code of Conduct applies within all community spaces, and also applies -when an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail -address, posting via an official social media account, or acting as an appointed +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at hadley@rstudio.com. +reported to the community leaders responsible for enforcement at codeofconduct@posit.co. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the @@ -114,13 +114,13 @@ community. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, -available at . +version 2.1, available at +. -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][https://github.com/mozilla/inclusion]. For answers to common questions about this code of conduct, see the FAQ at . Translations are available at . + +[homepage]: https://www.contributor-covenant.org diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 087f0b0..ed7650c 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -19,6 +19,8 @@ jobs: group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 2c5bb50..27d4528 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -31,7 +31,7 @@ jobs: covr::codecov( quiet = FALSE, clean = FALSE, - install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") ) shell: Rscript {0} diff --git a/DESCRIPTION b/DESCRIPTION index 1b0a51b..23c05f5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,8 +2,8 @@ Package: conflicted Title: An Alternative Conflict Resolution Strategy Version: 1.2.0.9000 Authors@R: c( - person("Hadley", "Wickham", , "hadley@rstudio.com", role = c("aut", "cre")), - person("RStudio", role = c("cph", "fnd")) + person("Hadley", "Wickham", , "hadley@posit.co", role = c("aut", "cre")), + person("Posit Software, PBC", role = c("cph", "fnd")) ) Description: R's default conflict management system gives the most recently loaded package precedence. This can make it hard to detect @@ -15,7 +15,7 @@ License: MIT + file LICENSE URL: https://conflicted.r-lib.org/, https://github.com/r-lib/conflicted BugReports: https://github.com/r-lib/conflicted/issues Depends: - R (>= 3.2) + R (>= 3.6) Imports: cli (>= 3.4.0), memoise, diff --git a/LICENSE b/LICENSE index 141b017..beaba9d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,2 +1,2 @@ -YEAR: 2020 +YEAR: 2023 COPYRIGHT HOLDER: conflicted authors diff --git a/LICENSE.md b/LICENSE.md index f37c75c..a411f95 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ # MIT License -Copyright (c) 2020 conflicted authors +Copyright (c) 2023 conflicted authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/R/shim.R b/R/shim.R index b12803a..0f8ba32 100644 --- a/R/shim.R +++ b/R/shim.R @@ -178,10 +178,10 @@ package_name <- function(package, character.only = FALSE) { } if (!is.character(package) || length(package) != 1L) { - abort("`package` must be character vector of length 1.") + cli::cli_abort("{.arg package} must be character vector of length 1.") } if (is.na(package) || (package == "")) { - abort("`package` must not be NA or ''.") + cli::cli_abort("{.arg package} must not be NA or ''.") } package diff --git a/README.Rmd b/README.Rmd index 44b5cb5..2f43624 100644 --- a/README.Rmd +++ b/README.Rmd @@ -27,8 +27,8 @@ Thanks to [\@krlmlr](https://github.com/krlmlr) for this neat idea! This code wa ## Installation ```{r, eval = FALSE} -# install.packages("devtools") -devtools::install_github("r-lib/conflicted") +# install.packages("pak") +pak::pak("r-lib/conflicted") ``` ## Usage diff --git a/README.md b/README.md index b4f4cf4..736825d 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ package. ## Installation ``` r -# install.packages("devtools") -devtools::install_github("r-lib/conflicted") +# install.packages("pak") +pak::pak("r-lib/conflicted") ``` ## Usage @@ -81,8 +81,7 @@ You can ask conflicted to report any conflicts in the current session: ``` r conflict_scout() -#> 2 conflicts -#> • `filter()`: dplyr +#> 1 conflict #> • `lag()`: dplyr and stats ``` diff --git a/_pkgdown.yml b/_pkgdown.yml index b425c53..117d266 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -7,3 +7,6 @@ template: includes: in_header: | + +development: + mode: auto diff --git a/man/conflicted-package.Rd b/man/conflicted-package.Rd index cfb42b8..f3d67eb 100644 --- a/man/conflicted-package.Rd +++ b/man/conflicted-package.Rd @@ -31,11 +31,11 @@ Useful links: } \author{ -\strong{Maintainer}: Hadley Wickham \email{hadley@rstudio.com} +\strong{Maintainer}: Hadley Wickham \email{hadley@posit.co} Other contributors: \itemize{ - \item RStudio [copyright holder, funder] + \item Posit Software, PBC [copyright holder, funder] } } diff --git a/tests/testthat/_snaps/shim.md b/tests/testthat/_snaps/shim.md new file mode 100644 index 0000000..4edeece --- /dev/null +++ b/tests/testthat/_snaps/shim.md @@ -0,0 +1,23 @@ +# package_name throws errors with invalid names + + Code + package_name_(c("x", "y")) + Condition + Error in `package_name()`: + ! `package` must be character vector of length 1. + Code + package_name_(1:10) + Condition + Error in `package_name()`: + ! `package` must be character vector of length 1. + Code + package_name_(NA_character_) + Condition + Error in `package_name()`: + ! `package` must not be NA or ''. + Code + package_name_("") + Condition + Error in `package_name()`: + ! `package` must not be NA or ''. + diff --git a/tests/testthat/test-shim.R b/tests/testthat/test-shim.R index 6cc1533..0daf99e 100644 --- a/tests/testthat/test-shim.R +++ b/tests/testthat/test-shim.R @@ -62,15 +62,14 @@ test_that("package_name mimics library", { }) test_that("package_name throws errors with invalid names" ,{ - x <- c("x", "y") - expect_error(package_name(quo(x), TRUE), "character vector") - - x <- 1:10 - expect_error(package_name(quo(x), TRUE), "character vector") - - x <- NA_character_ - expect_error(package_name(quo(x), TRUE), "NA") - - x <- "" - expect_error(package_name(quo(x), TRUE), "''") + package_name_ <- function(x) { + package_name(quo(x), character.only = TRUE) + } + + expect_snapshot(error = TRUE, { + package_name_(c("x", "y")) + package_name_(1:10) + package_name_(NA_character_) + package_name_("") + }) })